Re: using vars in ddl in procedure call - Mailing list pgsql-general

From Gauthier, Dave
Subject Re: using vars in ddl in procedure call
Date
Msg-id 0AD01C53605506449BA127FB8B99E5E11802F7D0@FMSMSX105.amr.corp.intel.com
Whole thread Raw
In response to Re: using vars in ddl in procedure call  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Yup, works like a charm.
Thanks Salah and Tom for the advise !
-dave

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

"Gauthier, Dave" <dave.gauthier@intel.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_identand quote_literal are your friends). 

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [postgis-users] pg_dump -s should use add_geometrycolumn(...)
Next
From: Andres Freund
Date:
Subject: Re: [postgis-users] pg_dump -s should use add_geometrycolumn(...)