pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Barrett <jbarrett@familynetwork.com>
To: pgsql-sql@postgresql.org
Subject: \set variant for use in regular sql commands
Date: Wed, 15 Aug 2001 11:08:42 -0400
Message-ID: <9le3n2$1e79$1@news.tht.net> (raw)

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





Message-ID: <9le3n2$1e79$1@news.tht.net>
Permalink:  ../9le3n2$1e79$1@news.tht.net/
Also on:    postgresql.org/message-id/9le3n2$1e79$1@news.tht.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jbarrett@familynetwork.com
  Subject: Re: \set variant for use in regular sql commands
  In-Reply-To: <9le3n2$1e79$1@news.tht.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox