Psql Internal Variable question

From: Prafulla Tekawade <prafulla_t(at)users(dot)sourceforge(dot)net>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Psql Internal Variable question
Date: 2011-06-01 03:52:45
Message-ID: BANLkTimvW4TXJb2FXmiaAN450bnR6hW0_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am trying to use psql \set and \echo commands to set some internal
variables.
My variable starts with single quote and ends with single quote.
That is actual value of the variable.

Eg.
set cur_db 'pgdb'
\echo :cur_db
--I am expecting here 'pgdb' but psql shows pgdb

As mentioned above, I am expecting \echo to return 'pgdb' to me but it
returns pgdb.
I tried using escape char, but it did not work.
Can somebody help me?

--
Best Regards,
Prafulla V Tekawade

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brendan Jurd 2011-06-01 03:55:26 Re: search_path versus dynamic CREATE SCHEMA
Previous Message Prafulla Tekawade 2011-06-01 03:49:53 Psql Internal Variable question