\set variant for use in regular sql commands

From: "Jeff Barrett" <jbarrett(at)familynetwork(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: \set variant for use in regular sql commands
Date: 2001-08-15 15:08:42
Message-ID: 9le3n2$1e79$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-08-15 15:10:36 Re: Re: Re: DateDiff, IsNull?
Previous Message Jan Wieck 2001-08-15 14:02:11 Re: on update restrict