Re: Missing schema name

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Michael Shapiro <mshapiro51(at)gmail(dot)com>
Cc: "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com>, "pgadmin-support(at)postgresql(dot)org" <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Missing schema name
Date: 2011-08-11 21:16:30
Message-ID: 1313097390.6322.31.camel@laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Thu, 2011-08-11 at 14:38 -0500, Michael Shapiro wrote:
> I have multiple schemas in my database. I do not have a search_path set for
> the database (so it wouold use the default: $user,public
> When I look at any table in any of the schemas, the table name has the
> schema prepended to it.
>
> If it isn't PgAdmin doing it, then it must be in the Pg server itself.
> How does PgAdmin get the DDL for a table from the server?
>

pgAdmin doesn't get the DDL, it builds it from all the properties it
grabed in the system catalog. What's more interesting is how it gets the
default schema. It's the first valid one in the search_path parameter
(with one caveat, if you have $user in your search_path, pgadmin will
replace it with your username, and check if it's a valid schema name).
So, IOW, with search_path=a,$user,b,c,d,e, and connection as guillaume,
with no a and guillaume schemas, but an existing c schema, the default
schema will be c. Every object with this schema won't have their schema
name prepended. Every other object will have.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Guillaume Lelarge 2011-08-11 21:17:10 Re: Timing out.
Previous Message Michael Shapiro 2011-08-11 21:10:08 Re: Timing out.