string variable with spaces in psql - Mailing list pgsql-sql

From AndreT
Subject string variable with spaces in psql
Date
Msg-id b6effv$eir$1@news.hub.org
Whole thread Raw
List 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                            >
<------------------------------------------------->



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: simple trigger question ...
Next
From: Walter McGinnis
Date:
Subject: pesky plpgsql