Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7FFWuP13363 for ; Wed, 15 Aug 2001 11:32:56 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f7FFFst47343 for pgsql-sql@postgresql.org; Wed, 15 Aug 2001 11:15:54 -0400 (EDT) (envelope-from news) From: "Jeff Barrett" X-Newsgroups: comp.databases.postgresql.sql Subject: \set variant for use in regular sql commands Date: Wed, 15 Aug 2001 11:08:42 -0400 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 16 Message-ID: <9le3n2$1e79$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: pgsql-sql@postgresql.org X-Archive-Number: 200108/211 X-Sequence-Number: 4443 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