Miguel has asked for the wisdom of the Perl Monks concerning the following question:
I wrote a Perl program wich uses PostgreSQL. This program was running well for months until yesterday, when my SysAdmin upgraded the DBD::Pg module for the current version (1.40).
Now, where I have
Raises 2 errors:my $sql = " LOCK TABLE tabreserves IN SHARE MODE; SELECT tabreserves.date, tabreserves.hour_i, tabreserves.hour_e, tabreserves.idreserve, tabreserves.fk_idfield, tabfields.imped, tabfields.design FROM tabreserves LEFT JOIN tabfields ON tabfields.idfield = tabreserves.fk_idfield WHERE date = ? AND (hour_i < ? AND hour_e > ?) AND (fk_idfield = ? OR ? = ANY (imped)) LIMIT 1 ";
1st
DBD::Pg::st execute failed: ERROR: cannot insert multiple commands in +to a prepared statement
If I delete the first line LOCK TABLE tabreserves IN SHARE MODE;, raises another error.
2nd
DBD::Pg::st execute failed: ERROR: column "hour_i" is of type integer + but expression is of type character varying HINT: You will need to rewrite or cast the expression.
Needless to say that I have _many_ statements wich uses the same structure - e.g. multiple commands in a prepared statement and not casting expressions, since that wasn't mandatory before.
When we (me and the sysadmin) saw the errors we thought: "well... time to upgrade to PostgreSQL 8!". We were using 7.4. We did the upgrade. But the errors persist.
What am I missing here? Do I really need to cast expressions? and why can't I use multiple statements now?
Thanks,
Miguel
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need help with DBD::Pg
by injunjoel (Priest) on Feb 23, 2005 at 19:46 UTC | |
by Miguel (Friar) on Feb 23, 2005 at 21:54 UTC | |
|
Re: Need help with DBD::Pg
by thor (Priest) on Feb 23, 2005 at 19:34 UTC | |
by Miguel (Friar) on Feb 23, 2005 at 21:48 UTC | |
by thor (Priest) on Feb 24, 2005 at 12:17 UTC | |
|
Re: Need help with DBD::Pg
by eclark (Scribe) on Feb 23, 2005 at 21:44 UTC | |
by Miguel (Friar) on Feb 23, 2005 at 22:07 UTC | |
by eclark (Scribe) on Feb 23, 2005 at 22:40 UTC | |
by Miguel (Friar) on Feb 23, 2005 at 23:11 UTC | |
by eclark (Scribe) on Feb 24, 2005 at 17:36 UTC | |
by Anonymous Monk on Feb 25, 2005 at 14:15 UTC |