Re: psql substitution variables - Mailing list pgsql-general

From Harald Fuchs
Subject Re: psql substitution variables
Date
Msg-id pu1wllgwhj.fsf@srv.protecting.net
Whole thread Raw
In response to psql substitution variables  ("Merlin Moncure" <mmoncure@gmail.com>)
Responses Re: psql substitution variables  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-general
In article <b42b73150701230831t317595f6o3beb37d43f363412@mail.gmail.com>,
"Merlin Moncure" <mmoncure@gmail.com> writes:

> 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;
> [...]

Can't you put the psql call into a shell script and use shell variable
substitution for that?

pgsql-general by date:

Previous
From: "Robert Sanford"
Date:
Subject: Date Questions
Next
From: Tom Lane
Date:
Subject: Re: Date Questions