pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Prepare plan in plpgsql
2+ messages / 2 participants
[nested] [flat]

* Prepare plan in plpgsql
@ 2005-07-06 19:32 Jocelyn Turcotte <turcotte.j@gmail.com>
  2005-07-06 19:55 ` Re: Prepare plan in plpgsql Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Jocelyn Turcotte @ 2005-07-06 19:32 UTC (permalink / raw)
  To: pgsql-sql

Hi,
i'm wondering if there is a way to prepare and execute a plan in a
plpgsql function.

The prepare seems to work as expected but obviously the execute
plan_name(...) statement is interpreted as the plpgsql execute keyword
and says me that the plan_name function don't exists

is there a way to use prepared queries in plpgsql?
if not what is the best way to pass a parameter directly to a query?
(im using postGIS and it would be nice if I could use another way that
unparsing and parsing a geometry parameter in an execute dynamic
query)

thank you and have all a nice day!



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Prepare plan in plpgsql
  2005-07-06 19:32 Prepare plan in plpgsql Jocelyn Turcotte <turcotte.j@gmail.com>
@ 2005-07-06 19:55 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2005-07-06 19:55 UTC (permalink / raw)
  To: Jocelyn Turcotte <turcotte.j@gmail.com>; +Cc: pgsql-sql

Jocelyn Turcotte <turcotte.j@gmail.com> writes:
> i'm wondering if there is a way to prepare and execute a plan in a
> plpgsql function.

You do not need that because plpgsql automatically caches plans for
SQL statements appearing in a plpgsql function.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-07-06 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-06 19:32 Prepare plan in plpgsql Jocelyn Turcotte <turcotte.j@gmail.com>
2005-07-06 19:55 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox