Re: Variables in SQL scripts

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Variables in SQL scripts
Date: 2010-06-10 11:07:45
Message-ID: m3r5kfcfi6.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Machiel Richards" <machielr(at)rdc(dot)co(dot)za> wrote:

> [...]
> I did some googling as well and found something I tested using
> a simple method:

> - I created an sql script to set the variable Name DB

> o \set DB <dbname>

> o \c :DB

> - I connected to postgresql using the postgres database and ran the
> sql script which seemed to work fine as it then connected me to the
> database.

> However will this method work with the above situation as well or are there
> other ways of doing this?
> [...]

Why don't you try it?

Tim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-06-10 11:18:26 Linux kernel OOM killer rewrite
Previous Message Thom Brown 2010-06-10 09:12:53 Where has ms2pg gone?