X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id BD916D1EFFD for ; Mon, 10 May 2004 07:50:05 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 84628-10 for ; Mon, 10 May 2004 07:49:47 -0300 (ADT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by svr1.postgresql.org (Postfix) with SMTP id F1D74D1F062 for ; Mon, 10 May 2004 07:49:42 -0300 (ADT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Mon May 10 12:49:36 2004 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id MAA11220; Mon, 10 May 2004 12:49:36 +0200 (METDST) From: Christoph Haller Message-Id: <200405101049.MAA13883@rodos> Subject: Re: working with schema To: wei.liang@eudoramail.com Date: Mon, 10 May 2004 12:49:35 METDST Cc: pgsql-sql@postgresql.org In-Reply-To: ; from "William Anthony Lim" at May 10, 104 10:29 am X-Mailer: Elm [revision: 212.4] X-Virus-Scanned: by amavisd-new at postgresql.org X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char 9C hex) in message header 'Received' Received: \234by rodos.fzk.de... ^ X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/84 X-Sequence-Number: 17798 > > 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