Search Postgresql Archives

Re: computed values in plpgsql

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

 



On Tue, Sep 29, 2009 at 05:42:37PM +0200, Pavel Stehule wrote:
> you cannot use double quotes. It's not php.

Normally yes, but *inside* literals you do indeed want double quotes.


I think the OP wants to be using quote_literal here.  I.e. instead of:

  execute 'insert into foo_something select (''' || new::text || '''::foo).*';

it wants to be closer to:

  execute 'insert into foo_something select (foo ' || quote_literal(new) || ').*;';

but it's a bit fiddly and I may have got that wrong somewhere else.

-- 
  Sam  http://samason.me.uk/

-- 
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