pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: pgsql-sql@postgresql.org
Cc: andret.NOSPAM@atio.co.za
Subject: Re: string variable with spaces in psql
Date: Fri, 04 Apr 2003 11:21:15 +0200
Message-ID: <3E8D4E8B.1000402@rodos.fzk.de> (raw)

 >
 > 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




view thread (2+ messages)

Message-ID: <3E8D4E8B.1000402@rodos.fzk.de>
Permalink:  ../3E8D4E8B.1000402@rodos.fzk.de/
Also on:    postgresql.org/message-id/3E8D4E8B.1000402@rodos.fzk.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ch@rodos.fzk.de, andret.NOSPAM@atio.co.za
  Subject: Re: string variable with spaces in psql
  In-Reply-To: <3E8D4E8B.1000402@rodos.fzk.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox