Re: update phenomenom

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: update phenomenom
Дата
Msg-id 3EE24529.9020905@Yahoo.com
обсуждение исходный текст
Ответ на update phenomenom  ("Henrik Steffen" <steffen@city-map.de>)
Список pgsql-general
Henrik Steffen wrote:
> hi,
>
> I tried both:
>
>  $command="UPDATE table SET miano='12345'; commit; ' WHERE ... ;";
>
>
> and
>
>  $command="UPDATE table SET miano='12345'; -- ' WHERE ... ;";
>
>
> neither worked.

What do you mean "neither worked"?

the second form works just like a charm. I checked it with PG 7.3.3, DBI
1.14 and DBD::Pg 0.95.

>
> it just gives an error and dies.
> no update done.

What error and where is that coming from? If I use the comment hack it
doesn't show any message in the postmaster log. It is totally happy with
it and shows exactly the symptom you described.

> I looked at man DBI, but couldn't find any restriction
> for $dbh->prepare() .... I am not sure, if it's possible
> to pass multiple statements to the prepare-method.

I'm not too familiar with Perl, but if DBD blindly forwards the query
given in the string argument of prepare() into libpq's pg_exec() ... and
it is supposed to do it that way ... then it is possible to pass
multiple statements. This is a long standing functionality of the
frontend/backend protocol.


Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


В списке pgsql-general по дате отправления:

Предыдущее
От: "Henrik Steffen"
Дата:
Сообщение: Re: update phenomenom
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Rowtype or Record parameters to pl/pgsql functions