Re: [GENERAL] Pgsql dynamic statements and null values

2005-03-09 Thread Guy Rouillier
Ragnar Hafstaư wrote: > On Tue, 2005-03-08 at 16:30 -0600, Guy Rouillier wrote: >> We use a dynamic statement in a pgsql stored function to insert rows >> into a table determined at run time. After much debugging, I've >> discovered that a null incoming argument will cause the dynamic >> statement

Re: [GENERAL] Pgsql dynamic statements and null values

2005-03-09 Thread Martijn van Oosterhout
On Tue, Mar 08, 2005 at 04:30:54PM -0600, Guy Rouillier wrote: > This is such a common usage pattern that I'm pretty sure I'm missing > something basic. Pgsql provides quote_literal to aid with inserting a > literal string into a dynamically prepared statement. My opinion is > that quote_literal

Re: [GENERAL] Pgsql dynamic statements and null values

2005-03-09 Thread Ragnar Hafstaư
On Tue, 2005-03-08 at 16:30 -0600, Guy Rouillier wrote: > We use a dynamic statement in a pgsql stored function to insert rows > into a table determined at run time. After much debugging, I've > discovered that a null incoming argument will cause the dynamic > statement to evaluate to null. The e

[GENERAL] Pgsql dynamic statements and null values

2005-03-08 Thread Guy Rouillier
We use a dynamic statement in a pgsql stored function to insert rows into a table determined at run time. After much debugging, I've discovered that a null incoming argument will cause the dynamic statement to evaluate to null. The error message emitted is "unable to execute null statement." I p