Search Postgresql Archives

Re: Prepared statement already exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	Albe Laurenz wrote:

You'll have to find a way to pick or generate unique names for the
prepared statements.
You could check for name collisions and disambiguate with a suffix
or something.

By the way, why do the prepared statements require to be named at all?
With other DBMS such as oracle or mysql, one can prepare statements without providing any name for them: the prepare() step returns a "statement handle" that is to be passed to subsequent exec() calls, no unique name is involved. I know that you can pass an empty string to PQPrepare(), but only one such statement can be used at a time, so it's not the same thing.

Currently with pg, using prepared statements more or less implies implementing an application-wide policy about naming them, otherwise there is always the risk that some code upper in the stack has a live statement with the same name. And what about contributed code or libraries? That would be easier if this global namespace for prepared statements didn't exist in the first place.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux