prepared statements and DBD::Pg

From: JP Fletcher <jpfletch(at)ca(dot)afilias(dot)info>
To: pgsql-general(at)postgresql(dot)org
Subject: prepared statements and DBD::Pg
Date: 2009-05-06 15:39:57
Message-ID: 4A01AF4D.7080807@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I see different behavior with DBI/DBD::Pg (1.607/2.11.8, pg 8.1) when
the first command in a prepared statement is 'CREATE TEMP TABLE'.

For instance, this works:

my $prepare_sql =<<SQL;
CREATE TEMP TABLE foo( id int, user_id int,);

INSERT INTO foo(1, 1);

INSERT INTO foo(2, 2);
SQL

my $sth = $dbh->prepare($prepare_sql);

This produces the error

ERROR: cannot insert multiple commands into a prepared statement

my $prepare_sql =<<SQL;

INSERT INTO foo(1, 1);

INSERT INTO foo(2, 2);
SQL

my $sth = $dbh->prepare($prepare_sql);

Is this the expected behaviour?

--
JP Fletcher
Database Administrator
Afilias Canada
voice: 416.646.3304 ext. 4123
fax: 416.646.3305
mobile: 416.561.4763
jpfletch(at)ca(dot)afilias(dot)info

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2009-05-06 15:40:40 Re: XML -> PG ?
Previous Message Christophe 2009-05-06 15:31:57 Re: XML -> PG ?