psql substitution variables

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "pgsql-general postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: psql substitution variables
Date: 2007-01-23 16:31:13
Message-ID: b42b73150701230831t317595f6o3beb37d43f363412@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

can anybody think of of a way to sneak these into dollar quoted
strings for substitution into create function?

would i would ideally like to do is (from inside psql shell)

\set foo 500

create function bar() returns int as
$$
declare
baz int default :foo;
[...]

that would eliminate the need for using the c preprocessor (or similar
tool) in some cases that require substitution in that way and (best of
all) allow psql to grok pre defined constants defined externally.

merlin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Schmidt 2007-01-23 16:50:39 PostgreSQL 8.2 utilities with Java app on Windows XP
Previous Message Steven De Vriendt 2007-01-23 16:22:40 PostgreSQL 8.1: createdb: xflush error ?