Help with DBD::Pg

From: Santinho (ms_at_simplicidade.com)
Date: 02/23/05


Date: Wed, 23 Feb 2005 17:17:48 +0000

Greetings,

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

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
";

Raises 2 errors:

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



Relevant Pages

  • Re: [HACKERS] friday 13 bug?
    ... I personally ran into the exact same thing with another customer. ... We had to upgrade ... them to 2.4.23 and reboot. ... > postgresql stops accepting connection. ...
    (Linux-Kernel)
  • Etch (7.4) -> Lenny (8.3) PostgreSQL upgrade issues
    ... but the PostgreSQL update didn't quite work out... ... The second command, instead of performing the upgrade, responded with: ... and ps confirmed that no postgres processes were running. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: SOLVED: help! - how to get postgres 7.3 back
    ... > of postgresql and postgresql-client. ... That installed 7.4 and the postinstall ... as the upgrade will be heading my way soon. ...
    (Debian-User)
  • php problem with pg_connect()
    ... Too many open links in ... Connection status bad ... prior to doing the upgrade I did a save of the postgresql db as required ... under postgresql and after the upgrade I followed the procedure to restore ...
    (Fedora)
  • Re: TMobile change thier mind?
    ... gold on 2003 for domestic PocketPCs. ... > prepared statement, however, it was no longer dated. ... >> upgrade for the PPC Phone Edition. ...
    (microsoft.public.pocketpc.phone_edition)