Re: Prepared statement already exists

From: WireSpot <wirespot(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Prepared statement already exists
Date: 2008-11-20 14:03:08
Message-ID: b2d4b0380811200603x1f0fc76akb237a0dba50ca456@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 20, 2008 at 15:45, Sam Mason <sam(at)samason(dot)me(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-20 14:07:24 Re: Prepared statement already exists
Previous Message Scara Maccai 2008-11-20 13:59:13 Re: return MAX and when it happened