Re: Renaming schema's - Mailing list pgsql-general

From Joe Conway
Subject Re: Renaming schema's
Date
Msg-id 3DEAB53B.1060502@joeconway.com
Whole thread Raw
In response to Re: Renaming schema's  (Jochem van Dieten <jochemd@oli.tudelft.nl>)
List pgsql-general
Jochem van Dieten wrote:
> After looking at some more databases it turned out that the public
> schema always has OID 2200. I would expect pgAdminII assuming that OID
> 2200 = public schema to be the cause of this problem (I tried messing
> with ACL's to no avail and changing the name of other schema's works).
>
> So the question becomes if OID 2200 is reserved or hardcoded in the
> backend for the public schema or if this assumption from pgAdminII is
> incorrect?
>

Are you sure it isn't an issue with your search path? e.g.:

regression=# select oid,* from pg_namespace ;
   oid   |  nspname   | nspowner | nspacl
--------+------------+----------+--------
      11 | pg_catalog |        1 | {=U}
      99 | pg_toast   |        1 | {=}
    2200 | public     |        1 | {=UC}
   16766 | pg_temp_1  |        1 |
  822259 | MySchema   |        1 |
(5 rows)

regression=# \dt
         List of relations
  Schema | Name | Type  |  Owner
--------+------+-------+----------
  public | foo  | table | postgres
(1 row)

regression=# update pg_namespace set nspname='joe' where oid = 2200;
UPDATE 1
regression=# select oid,* from pg_namespace ;
   oid   |  nspname   | nspowner | nspacl
--------+------------+----------+--------
      11 | pg_catalog |        1 | {=U}
      99 | pg_toast   |        1 | {=}
   16766 | pg_temp_1  |        1 |
  822259 | MySchema   |        1 |
    2200 | joe        |        1 | {=UC}
(5 rows)

regression=# \dt
No relations found.
regression=# show search_path;
  search_path
--------------
  $user,public
(1 row)

regression=# set search_path to '$user','joe';
SET
regression=# \dt
         List of relations
  Schema | Name | Type  |  Owner
--------+------+-------+----------
  joe    | foo  | table | postgres
(1 row)

HTH,

Joe


pgsql-general by date:

Previous
From: "Grand Titus"
Date:
Subject: Re: how to make an 'UNLOCK'?
Next
From: Tom Lane
Date:
Subject: Re: Renaming schema's