pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: AndreT <andret.NOSPAM@atio.co.za>
To: pgsql-sql@postgresql.org
Subject: string variable with spaces in psql
Date: Wed, 02 Apr 2003 12:53:52 +0200
Message-ID: <b6effv$eir$1@news.hub.org> (raw)

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




view thread (2+ messages)  latest in thread

Message-ID: <b6effv$eir$1@news.hub.org>
Permalink:  ../b6effv$eir$1@news.hub.org/
Also on:    postgresql.org/message-id/b6effv$eir$1@news.hub.org

 · 

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: andret.NOSPAM@atio.co.za
  Subject: Re: string variable with spaces in psql
  In-Reply-To: <b6effv$eir$1@news.hub.org>

* 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