Skip site navigation (1) Skip section navigation (2)

Re: computed values in plpgsql

From: Reid Thompson <reid(dot)thompson(at)ateb(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: computed values in plpgsql
Date: 2009-09-28 17:29:18
Message-ID: 1254158958.26990.1.camel@raker.ateb.com (view raw or flat)
Thread:
Lists: pgsql-general
On Mon, 2009-09-28 at 12:42 -0400, Merlin Moncure wrote:

> the best way to do this is very version dependent.  the basic trick is
> to use text cast to pass a composite type into the query sting.
> 
> one way:
> execute 'insert into foo_something select (' || new::text || '::foo).*';
> 
> you can try:
> execute 'insert into foo_something select ($1::foo).*' using new::text;
> 
> merlin

thanks,  we're using version 8.3.7.

In response to

Responses

pgsql-general by date

Next:From: Pavel StehuleDate: 2009-09-28 17:29:20
Subject: Re: Functions returning multiple rowsets
Previous:From: John R PierceDate: 2009-09-28 17:08:20
Subject: Re: sync structures

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group