insert/update/delete statements returning a query response - Mailing list pgsql-hackers

From Barry Lind
Subject insert/update/delete statements returning a query response
Date
Msg-id 3C02ADB1.5090000@xythos.com
Whole thread Raw
Responses Re: insert/update/delete statements returning a query response
Re: insert/update/delete statements returning a query response
List pgsql-hackers
Is this behavior intended in the backend?  The problem is that when you 
create a rule on an object that calls a stored function and invoke that 
rule on an insert/update/delete statement your insert/update/delete 
statement will now return a query result to the front end over the FE/BE 
protocol.  (I am not sure this is the exact senerio, but something 
similar).  This means that the user now needs to perform a 
executeQuery() call when using these insert/update/delete statements in 
JDBC because the JDBC driver isn't able to accept a query response when 
issuing a insert/update/delete call.

thanks,
--Barry



-------- Original Message --------
Subject: Re: CallableStatements
Date: Mon, 26 Nov 2001 12:14:32 -0800 (PST)
From: Stuart Robinson <stuart@zapata.org>
To: Rene Pijlman <rene@lab.applinet.nl>
CC: <pgsql-jdbc@postgresql.org>

There are various circumstances where you might want to call a stored
procedure with an executeUpdate method. For example, let's suppose you
have a view that combines a couple of tables and you want an application
you're building to be able to write to it. Since views are read-only, you
would create a rule that intercepts the inserts and updates and fires off
a stored procedure instead. Since the application is doing an insert or an
update, it will use executeUpdate, but the stored procedure will have to
use select and return a result, causing the application to error out.

-Stuart

On Mon, 26 Nov 2001, Rene Pijlman wrote:
> On Mon, 26 Nov 2001 10:40:52 -0800 (PST), you wrote:> >But if you use the executeUpdate method, you'll get an error,
becauseit> >isn't expecting a result, no? So, how do you call a stored procedure 
 
using> >executeUpdate?>> You don't. In the current implementation you need to use a> SELECT statement. Why is that a
problem?>>Regards,> René Pijlman <rene@lab.applinet.nl>>
 

-- 
Stuart Robinson  [stuart@zapata.org]
http://www.nerdindustries.com
http://www.tzeltal.org


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Minor buglet in update...from (I think)
Next
From: Bruce Momjian
Date:
Subject: DEBUG lines in server log