pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SET database TO ...?
5+ messages / 4 participants
[nested] [flat]

* SET database TO ...?
@ 2003-09-15 14:46 ow <oneway_111@yahoo.com>
  2003-09-15 15:35 ` Re: SET database TO ...? A.Bhuvaneswaran <bhuvan@symonds.net>
  2003-09-15 20:08 ` Re: SET database TO ...? Achilleus Mantzios <achill@matrix.gatewaynet.com>
  0 siblings, 2 replies; 5+ messages in thread

From: ow @ 2003-09-15 14:46 UTC (permalink / raw)
  To: pgsql-sql

Hi,

Suppose, one server/postmaster is running several databases. Is there something
like "SET database TO whatever" (and I mean *database* not schema). I need this
to ensure that a script runs only against db for which it was desinged.

Thanks







__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: SET database TO ...?
  2003-09-15 14:46 SET database TO ...? ow <oneway_111@yahoo.com>
@ 2003-09-15 15:35 ` A.Bhuvaneswaran <bhuvan@symonds.net>
  1 sibling, 0 replies; 5+ messages in thread

From: A.Bhuvaneswaran @ 2003-09-15 15:35 UTC (permalink / raw)
  To: ow <oneway_111@yahoo.com>; +Cc: pgsql-sql

> Suppose, one server/postmaster is running several databases. Is there
> something like "SET database TO whatever" (and I mean *database* not
> schema). I need this to ensure that a script runs only against db for
> which it was desinged.

You can use PG* environment variables if you wish to write seperate script
for each databases.

regards,
bhuvaneswaran




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: SET database TO ...?
  2003-09-15 14:46 SET database TO ...? ow <oneway_111@yahoo.com>
@ 2003-09-15 20:08 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
  2003-09-15 15:33   ` Re: SET database TO ...? ow <oneway_111@yahoo.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Achilleus Mantzios @ 2003-09-15 20:08 UTC (permalink / raw)
  To: ow <oneway_111@yahoo.com>; +Cc: pgsql-sql

On Mon, 15 Sep 2003, ow wrote:

> Hi,
> 
> Suppose, one server/postmaster is running several databases. Is there something
> like "SET database TO whatever" (and I mean *database* not schema). I need this
> to ensure that a script runs only against db for which it was desinged.

[postgres@smadev ~]% psql
Welcome to psql 7.3.4, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

dynacom=# \c bab
You are now connected to database bab.
bab=# 
bab=# 
bab=# \c dynacom
You are now connected to database dynacom.
dynacom=# \q
[postgres@smadev ~]%

> 
> Thanks
> 
> 
> 
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
> 

-- 
==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-210-8981112
fax:    +30-210-8981877
email:  achill at matrix dot gatewaynet dot com
        mantzios at softlab dot ece dot ntua dot gr




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: SET database TO ...?
  2003-09-15 14:46 SET database TO ...? ow <oneway_111@yahoo.com>
  2003-09-15 20:08 ` Re: SET database TO ...? Achilleus Mantzios <achill@matrix.gatewaynet.com>
@ 2003-09-15 15:33   ` ow <oneway_111@yahoo.com>
  2003-09-15 16:15     ` Re: SET database TO ...? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: ow @ 2003-09-15 15:33 UTC (permalink / raw)
  To: Achilleus Mantzios <achill@matrix.gatewaynet.com>; +Cc: pgsql-sql

--- Achilleus Mantzios <achill@matrix.gatewaynet.com> wrote:
[...]
> dynacom=# \c bab
> You are now connected to database bab.
> bab=# 

I'm actually looking for a way to set database from a *script*, not psql
console, if this is possible (similar to "SET search_path TO whatever;").

Any ideas? Thanks









__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: SET database TO ...?
  2003-09-15 14:46 SET database TO ...? ow <oneway_111@yahoo.com>
  2003-09-15 20:08 ` Re: SET database TO ...? Achilleus Mantzios <achill@matrix.gatewaynet.com>
  2003-09-15 15:33   ` Re: SET database TO ...? ow <oneway_111@yahoo.com>
@ 2003-09-15 16:15     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2003-09-15 16:15 UTC (permalink / raw)
  To: ow <oneway_111@yahoo.com>; +Cc: Achilleus Mantzios <achill@matrix.gatewaynet.com>; pgsql-sql

ow <oneway_111@yahoo.com> writes:
> --- Achilleus Mantzios <achill@matrix.gatewaynet.com> wrote:
>> dynacom=# \c bab
>> You are now connected to database bab.

> I'm actually looking for a way to set database from a *script*, not psql
> console, if this is possible (similar to "SET search_path TO whatever;").

If the script is being fed to psql, it can use \c ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-09-15 20:08 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-15 14:46 SET database TO ...? ow <oneway_111@yahoo.com>
2003-09-15 15:35 ` A.Bhuvaneswaran <bhuvan@symonds.net>
2003-09-15 20:08 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
2003-09-15 15:33   ` ow <oneway_111@yahoo.com>
2003-09-15 16:15     ` Tom Lane <tgl@sss.pgh.pa.us>

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