pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: wei.liang@eudoramail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: working with schema
Date: Mon, 10 May 2004 12:49:35 METDST
Message-ID: <200405101049.MAA13883@rodos> (raw)
In-Reply-To: <MHOEFEAILEJLKBAA@whowhere.com>

> 
> Hi all,
> 
> I'm just experimenting with schema usage. I'm going to use it as a fake 'multi-database' system. Is Postgresql support coding schema name using string variable so I can pass it with parameter? I'm give u an example:
> 
> I have schema: D200401,D200402.D200403,D200404, etc.
> 
> I've set my user just like the schema name, so who login with D200401 will be using D200401 schema. When someone using D200401 schema, they sometime want to access another schema, so in my thought I can use variable like this:
> 
> sPointer='D200403'
> 
> select * from sPointer.myTable -- Question: How to write it to work properly?
> 
> Thanks
> 
> 
> William
> 
> 
SET search_path to D200401 ;
SET search_path to D200402 ; 
... 
should do the job. 

Regards, Christoph 




view thread (5+ messages)  latest in thread

Message-ID: <200405101049.MAA13883@rodos>
Permalink:  ../200405101049.MAA13883@rodos/
Also on:    postgresql.org/message-id/200405101049.MAA13883@rodos

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ch@rodos.fzk.de, wei.liang@eudoramail.com
  Subject: Re: working with schema
  In-Reply-To: <200405101049.MAA13883@rodos>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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