Re: prepared statements and DBD::Pg

Поиск
Список
Период
Сортировка
Искать
От
Keary Suska
Тема
Re: prepared statements and DBD::Pg
Дата
в 13:44:46
Msg-id
47626398-669A-4B55-85F3-43C8EF166335@esoteritech.com
Ответ на
Список
Дерево обсуждения
prepared statements and DBD::Pg JP Fletcher <jpfletch@ca.afilias.info>
Re: prepared statements and DBD::Pg Keary Suska <pgsql-general@esoteritech.com>
Re: prepared statements and DBD::Pg Andrej <andrej.groups@gmail.com>
Re: prepared statements and DBD::Pg Tim Bunce <Tim.Bunce@pobox.com>
Re: prepared statements and DBD::Pg David Fetter <david@fetter.org>
Re: prepared statements and DBD::Pg Tim Bunce <Tim.Bunce@pobox.com>
Re: prepared statements and DBD::Pg David Fetter <david@fetter.org>
Re: prepared statements and DBD::Pg Tim Bunce <Tim.Bunce@pobox.com>
Re: prepared statements and DBD::Pg David Fetter <david@fetter.org>
Re: prepared statements and DBD::Pg Tim Bunce <Tim.Bunce@pobox.com>
Re: prepared statements and DBD::Pg "Daniel Verite" <daniel@manitou-mail.org>
Re: prepared statements and DBD::Pg JP Fletcher <jpfletch@ca.afilias.info>
Re: prepared statements and DBD::Pg "Greg Sabino Mullane" <greg@turnstep.com>
Re: prepared statements and DBD::Pg "Daniel Verite" <daniel@manitou-mail.org>
On May 6, 2009, at 9:39 AM, JP Fletcher wrote:

> 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 =<       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 =<             INSERT INTO foo(1, 1);
>
>       INSERT INTO foo(2, 2);
>           SQL
>
>   my $sth = $dbh->prepare($prepare_sql);
>
>
> Is this the expected behaviour?
>


You should follow up on the DBD::Pg list, but I would guess that the  
module is doing a surface check to determine whether the statement is  
a candidate for being prepared. I bet that whenever the first  
statement is not a select, insert, delete, or update that you will not  
get an error. What is happening ion these cases is that no preparation  
is happening at all.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

В списке pgsql-general по дате отправления
От: David Fetter
Дата:
От: Joshua D. Drake
Дата:
FAQ