Re: altering the name of the public schema - Mailing list pgadmin-support

From Dave Page
Subject Re: altering the name of the public schema
Date
Msg-id 03AF4E498C591348A42FC93DEA9661B884FB@mail.vale-housing.co.uk
Whole thread Raw
In response to altering the name of the public schema  (Jochem van Dieten <jochemd@oli.tudelft.nl>)
Responses Re: altering the name of the public schema [SOLVED]  (Jochem van Dieten <jochemd@oli.tudelft.nl>)
List pgadmin-support

> -----Original Message-----
> From: Jochem van Dieten [mailto:jochemd@oli.tudelft.nl]
> Sent: 02 December 2002 01:48
> To: pgadmin-support@postgresql.org
> Subject: [pgadmin-support] altering the name of the public schema
>
>
> [restarting the "Renaming schema's" thread from pgsql-general]


I don't read -general, but there was part of this discussion on
-hackers.

> Using pgAdminII version 1.4.2 with PostgreSQL 7.3
>
> I can alter the name of a schema using:
> test=# update pg_catalog.pg_namespace
> test-#     set nspname = 'newname'
> test-#     where nspname = 'oldname';
>
> This works without a problem until I try to rename the public schema.
> For some reason this schema doesn't list among the schema's in a
> database anymore. Changing the name back to public will make it list
> again. But, even when it is not visible I can perform queries on it.
> psql does not have any problems.
>
> If I just add another entry into the pg_namespace table using
> an insert
> query it will show straight away as a schema in pgAdminII. So
> I presume
> the issue lies in the one thing I can't control in the pg_namespace
> table; the OID.
> Could it be that somewhere in pgAdminII there is a reference
> to the OID
> 2200 that is assigned to the public schema by default?

pgAdmin hides system objects by default, but in the case of the public
schema it makes an exception bcause hiding public would not be sensible.
It does it by a combination of name and OID: the oid is less than the
last system oid, so it is hidden, except if it is called public.

Switch on show System Objects on the view menu and you should see it.

Regards, Dave.

pgadmin-support by date:

Previous
From: Jochem van Dieten
Date:
Subject: altering the name of the public schema
Next
From: info@lespetitsplaisirs.com
Date:
Subject: kinda weird