string variable with spaces in psql

From: "AndreT" <andret(dot)NOSPAM(at)atio(dot)co(dot)za>
To: pgsql-sql(at)postgresql(dot)org
Subject: string variable with spaces in psql
Date: 2003-04-02 10:53:52
Message-ID: b6effv$eir$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

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?

Thanks
--
Andre Truter

<------------------------------------------------->
< The box said: Requires Windows 95 or better... >
< So I installed Linux >
<------------------------------------------------->

Browse pgsql-sql by date

  From Date Subject
Next Message Jeff Lu 2003-04-02 15:19:25 error: lost syncronization with server
Previous Message Mike Papper 2003-04-02 08:09:33 Finding if a temp table exists in the current connection