Running variable commands from psql

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org>
Subject: Running variable commands from psql
Date: 2010-08-30 16:55:55
Message-ID: 201008301655.o7UGttQ11412@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there a way to pass a psql variable into a \! command in psql, e.g.:

test=> \set x ls
test=> \! :x
:x: not found

I specifically want the currently connected database name to be passed
to a \! command.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Browse pgsql-general by date

  From Date Subject
Next Message Arjen Nienhuis 2010-08-30 17:16:11 Re: How to convert a binary filed to an integer field?
Previous Message Alvaro Herrera 2010-08-30 16:45:41 Re: Database corruption