I've found a workaround using the new pg 8.3 feature of default values
for function arguments. It is not a completely general workaround (it
won't, e.g. allow type or table names to be interpolated) but it does
what I need and perhaps others may find this trick useful.
To briefly recap the
On Tue, 2009-06-16 at 09:20 +0200, Albe Laurenz wrote:
I came up with the following:
psql -v foo=10
test= \set funcbody `echo 'SELECT\ `:foo`echo '`
test= create function foo() returns integer as :funcbody language sql;
But that is ugly as hell and depends on the underlying operating
J. Greg Davidson wrote:
Hi dear colleagues,
I'm trying to pull some platform-specific constants out of my
code by using psql variables, e.g.:
$ psql -v TypeLength=4
# CREATE TYPE tref (
INTERNALLENGTH = :TRefTypeLength,
INPUT = tref_in,
OUTPUT = tref_out,
PASSEDBYVALUE
);
Hi dear colleagues,
I'm trying to pull some platform-specific constants out of my
code by using psql variables, e.g.:
$ psql -v TypeLength=4
# CREATE TYPE tref (
INTERNALLENGTH = :TRefTypeLength,
INPUT = tref_in,
OUTPUT = tref_out,
PASSEDBYVALUE
);
which works fine, but when I need