Multiple statements in one prepare

Started by Robert Turnbullover 21 years ago3 messages
#1Robert Turnbull
rturnbull@strategicmind.com

How can multiple SQL statements be included in one prepare command? The goal is to reduce chatter between the client and server by submitting an atomic tranasaction set. My interface is libpq.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Turnbull (#1)
Re: Multiple statements in one prepare

"Robert Turnbull" <rturnbull@strategicmind.com> writes:

How can multiple SQL statements be included in one prepare command?

They can't. Consider using a plpgsql function, instead.

regards, tom lane

#3Neil Conway
neilc@samurai.com
In reply to: Robert Turnbull (#1)
Re: Multiple statements in one prepare

On 15-Apr-04, at 9:26 AM, Robert Turnbull wrote:

How can multiple SQL statements be included in one prepare command?
The goal is to reduce chatter between the client and server by
submitting an atomic tranasaction set.

You can submit multiple PREPARE commands in one query string (separated
by semi-colons), so the difference in FE/BE traffic should be
negligible.

-Neil