Re: update phenomenom - Mailing list pgsql-general

From Jan Wieck
Subject Re: update phenomenom
Date
Msg-id 3EE24529.9020905@Yahoo.com
Whole thread Raw
In response to update phenomenom  ("Henrik Steffen" <steffen@city-map.de>)
List 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 by date:

Previous
From: "Henrik Steffen"
Date:
Subject: Re: update phenomenom
Next
From: Joe Conway
Date:
Subject: Re: Rowtype or Record parameters to pl/pgsql functions