Re: EXECUTE problems - Mailing list pgsql-general

From Tom Lane
Subject Re: EXECUTE problems
Date
Msg-id 26270.1037992860@sss.pgh.pa.us
Whole thread Raw
In response to Re: EXECUTE problems  (Felipe Schnack <felipes@ritterdosreis.br>)
Responses Re: EXECUTE problems  (Felipe Schnack <felipes@ritterdosreis.br>)
List pgsql-general
Felipe Schnack <felipes@ritterdosreis.br> writes:
>   I think it should... after all, why you can use DEFAULT in an normal
> insert but you can't in an prepared insert statement?

PREPARE isn't specific to INSERT statements.  Even when you use it for
one, it's not very obvious how to assign a default value to the PREPARE
parameters; in any but the most trivial cases, there's not a one-for-one
correspondence between PREPARE parameters and target columns that might
(or might not) have defaults.

>   I'm asking this because I'm implementing methods to support the new
> DEFAULT keyword in pgsql 7.3 for the JDBC driver... but if I can't use
> it in prepared sqls, a great deal of it usefulness will be shortened...

PREPAREing a query as trivial as an INSERT ... VALUES is largely a
waste of time anyway.  So I cannot get excited about this.

            regards, tom lane

pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: database structure
Next
From: Jon Swinth
Date:
Subject: Re: Unwanted Log Entries