Re: Prepared statement already exists - Mailing list pgsql-general

From WireSpot
Subject Re: Prepared statement already exists
Date
Msg-id b2d4b0380811200603x1f0fc76akb237a0dba50ca456@mail.gmail.com
Whole thread Raw
In response to Re: Prepared statement already exists  (Sam Mason <sam@samason.me.uk>)
Responses Re: Prepared statement already exists
List pgsql-general
On Thu, Nov 20, 2008 at 15:45, Sam Mason <sam@samason.me.uk> wrote:
> On Wed, Nov 19, 2008 at 09:42:33PM +0200, WireSpot wrote:
>> I also imagined some workarounds in the code (PHP), such as defining a
>> global/static hash table and registering statement names with it. But
>> I'd like to know if there's a better way.
>
> Have you thought about using stored procedures instead of prepared
> statements?  No need to register them or keep track of that state.

I'm not sure if it would work. What I'm trying to do is have an
application layer which takes all the client queries and makes
prepared statements out of them. Do you mean to say I should make
stored procedures out of them instead? Granted, CREATE FUNCTION has OR
REPLACE, but other than that it's only complicating matters. A
function needs to have the argument types defined, for example, I
can't get away with simply listing them like I do when executing a
statement.

pgsql-general by date:

Previous
From: Scara Maccai
Date:
Subject: Re: return MAX and when it happened
Next
From: Alvaro Herrera
Date:
Subject: Re: Prepared statement already exists