From igor@providerst.com.br Thu Oct 14 12:37:33 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E06BC32AEF1 for ; Thu, 14 Oct 2004 13:37:33 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83445-06 for ; Thu, 14 Oct 2004 12:37:21 +0000 (GMT) Received: from providerst.com.br (unknown [200.253.138.61]) by svr1.postgresql.org (Postfix) with ESMTP id 0BDAE32A17D for ; Thu, 14 Oct 2004 13:37:16 +0100 (BST) Brma: igor [192.168.1.104] Received: from sistemas (igor [192.168.1.104]) by providerst.com.br (8.11.6/8.11.6) with SMTP id i9ECU9p09415 for ; Thu, 14 Oct 2004 10:30:09 -0200 Message-ID: <001601c4b1eb$50f45fc0$6801a8c0@providerst.local> From: "Igor Maciel Macaubas" To: Subject: Database schemas: search_path Date: Thu, 14 Oct 2004 09:42:45 -0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0013_01C4B1D2.288611A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=HTML_20_30, HTML_FONTCOLOR_BLUE, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200410/178 X-Sequence-Number: 15171 This is a multi-part message in MIME format. ------=_NextPart_000_0013_01C4B1D2.288611A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I've organized my database design in multiple schemas, and migrated my exis= ting tables to different schemas by using a simple how-to I found in this l= ist history. But what I couldn't find was a way to make this schemata fully transparent = to my application - which does selects directly to tables instead to schema= .table. I know that I can always set the search_path environmnet variable, = but I have to do it on each session. I'd like to know if there is a way to = make my set search_path persistent on the database, no matter the session.= =20 I believe that this is supported, but couldn't find out how to make it. Can= someone help me? Having to add the 'set search_path =3D xxx,yyyy,zzzzz' everytime I connect = is pain for me and my application. Another question I have is: Let's say I have a simple database with 100 tables, divided in 10 schemas w= ith 10 tables in each. Let's say that my last schema is 10th_schema and my = last table is z_table (last by creation - is the most recent created table,= so I assume it's the last table on the database). My search_path is ascend= ing from the 1st_schema to the 10th_schema. Would my querie times/performance on table z_table be faster if this table = was created on the 1st_schema ? How does postgres make this search on the search_path to find where a table= is in? Thanks for your help, cya! Regards, Igor -- igor@providerst.com.br ------=_NextPart_000_0013_01C4B1D2.288611A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi all,
 
I've organized my database design in mu= ltiple=20 schemas, and migrated my existing tables to different schemas by using a si= mple=20 how-to I found in this list history.
But what I couldn't find was a way to m= ake this=20 schemata fully transparent to my application - which does selects directly = to=20 tables instead to schema.table. I know that I can always set the search_pat= h=20 environmnet variable, but I have to do it on each session. I'd like to know= if=20 there is a way to make my set search_path persistent on the database, no ma= tter=20 the session.
I believe that this is supported, but c= ouldn't=20 find out how to make it. Can someone help me?
 
Having to add the 'set search_path =3D= =20 xxx,yyyy,zzzzz' everytime I connect is pain for me and my=20 application.
 
Another question I have is:
Let's say I have a simple database with= 100=20 tables, divided in 10 schemas with 10 tables in each. Let's say that my las= t=20 schema is 10th_schema and my last table is z_table (last by creation - is t= he=20 most recent created table, so I assume it's the last table on the database)= . My=20 search_path is ascending from the 1st_schema to the 10th_schema.
Would my querie times/performance on ta= ble=20 z_table be faster if this table was created on the 1st_schema ?
How does postgres make this search on t= he=20 search_path to find where a table is in?
 
Thanks for your help, cya!
 
Regards,
Igor
--
igor@providerst.com.br
 
------=_NextPart_000_0013_01C4B1D2.288611A0-- From bruno@wolff.to Thu Oct 14 14:24:16 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 48A0E32C0A8 for ; Thu, 14 Oct 2004 15:24:16 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20618-08 for ; Thu, 14 Oct 2004 14:24:10 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 298E932C04A for ; Thu, 14 Oct 2004 15:24:11 +0100 (BST) Received: (qmail 27278 invoked by uid 500); 14 Oct 2004 14:34:32 -0000 Date: Thu, 14 Oct 2004 09:34:32 -0500 From: Bruno Wolff III To: Igor Maciel Macaubas Cc: pgsql-admin@postgresql.org Subject: Re: Database schemas: search_path Message-ID: <20041014143432.GA25803@wolff.to> Mail-Followup-To: Igor Maciel Macaubas , pgsql-admin@postgresql.org References: <001601c4b1eb$50f45fc0$6801a8c0@providerst.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001601c4b1eb$50f45fc0$6801a8c0@providerst.local> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/179 X-Sequence-Number: 15172 On Thu, Oct 14, 2004 at 09:42:45 -0300, Igor Maciel Macaubas wrote: > Hi all, > > I've organized my database design in multiple schemas, and migrated my existing tables to different schemas by using a simple how-to I found in this list history. > But what I couldn't find was a way to make this schemata fully transparent to my application - which does selects directly to tables instead to schema.table. I know that I can always set the search_path environmnet variable, but I have to do it on each session. I'd like to know if there is a way to make my set search_path persistent on the database, no matter the session. > I believe that this is supported, but couldn't find out how to make it. Can someone help me? Use ALTER DATABASE to set per database defaults. From igor@providerst.com.br Thu Oct 14 18:27:57 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5B24232B283 for ; Thu, 14 Oct 2004 19:27:57 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07067-06 for ; Thu, 14 Oct 2004 18:27:50 +0000 (GMT) Received: from providerst.com.br (unknown [200.253.138.61]) by svr1.postgresql.org (Postfix) with ESMTP id 43E1E32B1B3 for ; Thu, 14 Oct 2004 19:27:41 +0100 (BST) Brma: igor [192.168.1.104] Received: from sistemas (igor [192.168.1.104]) by providerst.com.br (8.11.6/8.11.6) with SMTP id i9EIJwp01814; Thu, 14 Oct 2004 16:20:00 -0200 Message-ID: <001601c4b21c$2fdd09a0$6801a8c0@providerst.local> From: "Igor Maciel Macaubas" To: "Jaime Casanova" , References: <20041014161946.26948.qmail@web50006.mail.yahoo.com> Subject: Re: Database schemas: search_path Date: Thu, 14 Oct 2004 15:32:33 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/186 X-Sequence-Number: 15179 Hi, Thanks, I did it using alter database and worked fine. Thanks for all! Regards, Igor -- igor@providerst.com.br ----- Original Message ----- From: "Jaime Casanova" To: Sent: Thursday, October 14, 2004 1:19 PM Subject: Re: [ADMIN] Database schemas: search_path > --- Bruno Wolff III escribió: >> On Thu, Oct 14, 2004 at 09:42:45 -0300, >> Igor Maciel Macaubas >> wrote: >> > Hi all, >> > >> > I've organized my database design in multiple >> schemas, and migrated my existing tables to >> different schemas by using a simple how-to I found >> in this list history. >> > But what I couldn't find was a way to make this >> schemata fully transparent to my application - which >> does selects directly to tables instead to >> schema.table. I know that I can always set the >> search_path environmnet variable, but I have to do >> it on each session. I'd like to know if there is a >> way to make my set search_path persistent on the >> database, no matter the session. >> > I believe that this is supported, but couldn't >> find out how to make it. Can someone help me? >> >> Use ALTER DATABASE to set per database defaults. >> > > Hi, > set the parameter in the postgresql.conf > > Regards, > Jaime Casanova > > _________________________________________________________ > Do You Yahoo!? > Información de Estados Unidos y América Latina, en Yahoo! Noticias. > Visítanos en http://noticias.espanol.yahoo.com > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org