Re: apostrophes and psql variables

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Ilja Golshtein <ilejn(at)yandex(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: apostrophes and psql variables
Date: 2006-08-17 13:15:27
Message-ID: 20060817131527.GA90172@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 17, 2006 at 05:05:00PM +0400, Ilja Golshtein wrote:
> Is there any way to have psql variable in apostrophes?
>
> The idea is to do something like this
>
> \set var 'some value'
> insert into aaa values(:var)

test=> \set var '\'some value\''
test=> insert into aaa values (:var);
INSERT 0 1
test=> select * from aaa;
val
------------
some value
(1 row)

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dawid Kuroczko 2006-08-17 14:03:46 Re: Best approach for a "gap-less" sequence
Previous Message Ilja Golshtein 2006-08-17 13:05:00 apostrophes and psql variables