Older Postgresql DB with relationships.txt?

Login or register to post comments
6 replies [Last post]
Offline
Joined: 06/25/2009

Hello,

I'm currently trying to setup an older Postgresql (7.4.8) server with QCubed. The code-gen stuff won't work (presumably because I'm using 7.4, it errors out with "function pg_get_serial_sequence() does not exist"), so I thought I would manually define my relationships by modifying the codegen.xml file, and pointing to my relationships.txt file (I used the full filesystem path).

However, now that I've done that (I just did one relationship to see how/if it would work), it's still erroring out with the above pg_get_serial_sequence() function error.

Does anybody have any recommendations about what I could do (should this even be possible)? Thanks!

alex94040's picture
Offline
Joined: 11/06/2008

I'm not a Postgre expert in any way, but I'll ask the stupid question just in case: is it at all possible for you to upgrade to a more recent version of Postgre?

Offline
Joined: 06/25/2009

No, unfortunately not (trust me, if it was under my control, I would have upgraded yesterday!).

alex94040's picture
Offline
Joined: 11/06/2008

From the limited research I've done, it seems that pg_get_serial_sequence() is a fundamental piece that returns the ID of the last inserted row, similarly to mysql_insert_id() in MySQL... I can't imagine the database adapter working without it. So hand-coding the foreign keys with relationships.txt won't make any difference at all.

It looks like this built-function is used in two places in _core\database\QPostgreSqlDatabase.class.php. Do you know of a way to get the "last ID" in the old version of Posgre? If so, you may want to edit that file and try replacing that function call with an alternate way to do this.

If that doesn't work, let us know, and hopefully one of the Posgre experts can also weigh in.

OOPMan's picture
Offline
Joined: 11/07/2008

Postgres must have that pg_get_serial_sequence() function in older version...

It sounds to me like PHP doesn't have the PgSql module installed or loaded. Have you checked using

<?php
phpinfo
();
?>
whether or not a PgSql module is actually loaded into PHP?

Offline
Joined: 06/25/2009

Yeah, phpinfo() reports it as 8.0.15 (even though the DB version is 7.4.8, which is located on a separate server offsite).

I wonder if that would cause problems, I may try to downgrade to 7.4.x on my PHP webserver, and see if that will help (not really sure at this point).

OOPMan's picture
Offline
Joined: 11/07/2008

Hmmmmmmmmmm, weird...