Re: using vars in ddl in procedure call

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: using vars in ddl in procedure call
Date: 2012-08-29 16:06:08
Message-ID: 0AD01C53605506449BA127FB8B99E5E11802F7D0@FMSMSX105.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yup, works like a charm.
Thanks Salah and Tom for the advise !
-dave

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, August 29, 2012 11:18 AM
To: Gauthier, Dave
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] using vars in ddl in procedure call

"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> writes:
> Trying (failing) a test to see if I can run ddl in a procedure where elements of the ddl are vars. Consider...

You'll need to construct the command as a string value and then run it with EXECUTE. Beware of quoting issues (quote_ident and quote_literal are your friends).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message lacmane 2012-08-29 16:08:38 PostGreSQL pgdac - C++ Builder 2007
Previous Message Tom Lane 2012-08-29 16:02:24 Re: [postgis-users] pg_dump -s should use add_geometrycolumn(...)