X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 308D5475ECE for ; Fri, 4 Apr 2003 04:21:22 -0500 (EST) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id 9AF9E475E82 for ; Fri, 4 Apr 2003 04:21:16 -0500 (EST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Fri Apr 04 11:21:16 2003 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id LAA03425; Fri, 4 Apr 2003 11:21:15 +0200 (METDST) Message-ID: <3E8D4E8B.1000402@rodos.fzk.de> Date: Fri, 04 Apr 2003 11:21:15 +0200 From: Christoph Haller User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/780; en-US; rv:1.3) Gecko/20030321 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: andret.NOSPAM@atio.co.za Subject: Re: string variable with spaces in psql Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-12.1 required=5.0 tests=BAYES_10,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/64 X-Sequence-Number: 12765 > > I need to define a variable in psql, but the variable needs to contain a > space: > > This is what I want to do; > > \set theName '\''John Nobody '\'' > SELECT add_agent( :theName, 'Test Company', 'Test Department' ); > > ... > etc > > Unfortunately psql removes the space, so that theName = 'JohnNobody' > > What do i need to do to preserve the space? > Did you try \set theName "John Nobody " Regards, Christoph