\set variant for use in regular sql commands - Mailing list pgsql-sql

From Jeff Barrett
Subject \set variant for use in regular sql commands
Date
Msg-id 9le3n2$1e79$1@news.tht.net
Whole thread Raw
List pgsql-sql
I need to use the \set command in regular sql (I am running postgres queries
through php and it does not seem to support the \ commands in general). How
can I set a variable with regular sql?

I want to be able to do the following:

\set testvar '1,2,3,4,5'
\set testvar '6,7,8,':testvar

Which is then used in: select * from table where id in (:testvar);

Thanks,

--Jeff




pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Re: Re: DateDiff, IsNull?
Next
From: Bruce Momjian
Date:
Subject: Re: Temp tables being written to disk. Avoidable?