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

From Sam Mason
Subject Re: Prepared statement already exists
Date
Msg-id 20081120141828.GN2459@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: Prepared statement already exists  (WireSpot <wirespot@gmail.com>)
List pgsql-general
On Thu, Nov 20, 2008 at 04:03:08PM +0200, WireSpot wrote:
> On Thu, Nov 20, 2008 at 15:45, Sam Mason <sam@samason.me.uk> wrote:
> > 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.

I think it depends on what level this abstraction wants to live.  If
its purpose is just to make queries run a bit quicker then, no, stored
procedures aren't going to help at all.  If this abstraction can be
given knowledge of the things that you actually want to do against the
database then stored procedures could be a win.

The best structure will be determined by your problem, I just thought
that mentioning another solution may push your mental model around a bit
to help clarify the "best" solution.


  Sam

pgsql-general by date:

Previous
From: "Sabin Coanda"
Date:
Subject: on error logs the whole multiline script
Next
From: WireSpot
Date:
Subject: Re: Prepared statement already exists