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

From Christoph Haller
Subject Re: string variable with spaces in psql
Date
Msg-id 3E8D4E8B.1000402@rodos.fzk.de
Whole thread Raw
In response to string variable with spaces in psql  ("AndreT" <andret.NOSPAM@atio.co.za>)
List pgsql-sql
>> I need to define a variable in psql, but the variable needs to contain a> space:>> This is what I want to do;>>
\settheName '\''John Nobody '\''> SELECT add_agent( :theName, 'Test Company', 'Test Department' );>> ...> etc>>
Unfortunatelypsql 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



pgsql-sql by date:

Previous
From: Manfred Koizar
Date:
Subject: Re: More wacky grouping
Next
From: Christoph Haller
Date:
Subject: Re: Finding if a temp table exists in the current connection