installing on postgresql?

13 views
Skip to first unread message

mikelietz

unread,
Dec 3, 2011, 11:20:08 PM12/3/11
to habari-dev
I can't seem to get Habari 0.8, or master, to install on postgresql. I
get errors in my server log about classes/logentry:101 and 195, and
the installer just reloads.

Is anybody else able to install on pgsql?

Bryce Campbell

unread,
Dec 3, 2011, 11:21:59 PM12/3/11
to habar...@googlegroups.com

Sorry, I use MySQL on all my servers.

--
To post to this group, send email to habar...@googlegroups.com
To unsubscribe from this group, send email to habari-dev-...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/habari-dev

Michael Nacos

unread,
Dec 6, 2011, 12:33:15 PM12/6/11
to habar...@googlegroups.com
I've managed to install previous version of habari on postgresql, I'll have a look.

--
To post to this group, send email to habar...@googlegroups.com
To unsubscribe from this group, send email to habari-dev-...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/habari-dev



--
Want to sign up for websites without giving your email? Ask me for a leemail.me invite.

Michael Nacos

unread,
Dec 11, 2011, 6:30:46 PM12/11/11
to habar...@googlegroups.com
I've used the recommended zipfile from here: http://habariproject.org/dist/habari_makaanga.zip and it installs fine.
What kind of errors did you get?

M.

Michael Bishop

unread,
Dec 11, 2011, 7:44:57 PM12/11/11
to habar...@googlegroups.com
Might be using the latest dev build, rather than that version, which is basically .7.x

~miklb

Michael C. Harris

unread,
Dec 11, 2011, 7:48:28 PM12/11/11
to habar...@googlegroups.com
On 12 December 2011 11:44, Michael Bishop <mi...@miklb.com> wrote:
> On Sun, Dec 11, 2011 at 6:30 PM, Michael Nacos <m.n...@gmail.com> wrote:>>>> I've used the recommended zipfile from here:>> http://habariproject.org/dist/habari_makaanga.zip and it installs fine.>> What kind of errors did you get?>
> Might be using the latest dev build, rather than that version, which is
> basically .7.x

The makaanga _should_ be the right version, but something seems to
have gone awry with the script that makes it. I'll look into that
later, but in the meantime, could you try
http://habariproject.org/dist/habari_head.zip ?

--
Michael C. Harris, School of CS&IT, RMIT University
http://twofishcreative.com/michael/blog
IRC: michaeltwofish #habari

Michael Nacos

unread,
Dec 11, 2011, 7:53:05 PM12/11/11
to habar...@googlegroups.com
michaeltwofish kindly pointed out smthg's wrong with this zipfile, so I tried installing again using the same setup and a new zipfile from HEAD. This time got:

ERROR:  duplicate key value violates unique constraint "testblog__log_types_module_key"

which stops installation in its tracks. Removing the UNIQUE constraint allows the installation to proceed just fine.

diff --git a/system/schema/pgsql/schema.sql b/system/schema/pgsql/schema.sql
index c4a128e..9d55cad 100644
--- a/system/schema/pgsql/schema.sql
+++ b/system/schema/pgsql/schema.sql
@@ -143,8 +143,7 @@ CREATE TABLE {$prefix}log_types (
   id INTEGER NOT NULL DEFAULT nextval('{$prefix}log_types_pkey_seq'),
   module VARCHAR(100) NOT NULL,
   type VARCHAR(100) NOT NULL,
-  PRIMARY KEY (id),
-  UNIQUE (module,type)
+  PRIMARY KEY (id)
 );

looking at the actual data in the db gives:

testblog=> SELECT * FROM testblog__log_types;
 id |   module   |      type     
----+------------+----------------
  1 | habari     | content
  2 | habari     | theme
  3 | habari     | default
  4 | habari     | user
  5 | habari     | authentication
  6 | habari     | content
  7 | habari     | comment
  8 | habari     | default
  9 | habari     | plugin
 10 | HabariSilo | plugin
 11 | Pingback   | Pingback
(11 rows)

so it's clear the {habari, content} combination gets registered twice, which violates the constraint.

This is actually good news. Install went fine and my postgres + habari 8 dummy blog seens fully functional, all you need to do is find out why {habari, content} is emitted twice.

cheers,

Michael

Andy C

unread,
Dec 20, 2011, 8:32:12 AM12/20/11
to habar...@googlegroups.com
You have just broken the referential integrity of your database.

Odd things may happen when code is presented with 2 records for 'habari - content' when only 1 is expected.

Not today, not tomorrow but when you are least expecting it.

I would remove second 'habari - content' record and reinstate the unique primary key on (module, type).

Obviously, the installer/upgrade should skip any attempts to re-insert pre-existing meta data and just add new records.

Michael C. Harris

unread,
Dec 20, 2011, 5:08:14 PM12/20/11
to habar...@googlegroups.com
The fix was to register types earlier, thus preventing a default being registered, which was causing the duplicate.

https://github.com/habari/system/commit/589f61220c0e35eff77020ac1a4cd24ab1b20962
> --
> To post to this group, send email to habar...@googlegroups.com
> To unsubscribe from this group, send email to habari-dev-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/habari-dev

--
Michael C. Harris
Reply all
Reply to author
Forward
0 new messages