Thread: system database flag?

system database flag?

From
"Jan-Peter Seifert"
Date:
Hello,

in order to get a clean template1 I dropped and recreated it:

UPDATE pg_database SET datistemplate = false WHERE datname = 'template1';

DROPDB -U postgres template1

CREATEDB -U postgres -T template0 template1

UPDATE pg_database SET datistemplate = true WHERE datname = 'template1';
GRANT CONNECT ON DATABASE template1 TO public;
GRANT ALL ON DATABASE template1 TO postgres;
COMMENT ON DATABASE template1 IS 'default template database'; 

However, when I view the properties of the new template1 in pgAdmin III it isn't stated that it's a system database
anymore.Is it because that the OID is different from 1 or is there a hidden flag? In pg_database I don't see any
significantdifference from other servers' template1?
 

Could you tell me, please?

Thank you very much,

Peter

P.S. I used the hints on http://www.postgresql.org/docs/8.3/interactive/manage-ag-templatedbs.html

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01


Re: system database flag?

From
Guillaume Lelarge
Date:
Le jeudi 23 avril 2009 à 12:29:33, Jan-Peter Seifert a écrit :
> [...]
> in order to get a clean template1 I dropped and recreated it:
>
> UPDATE pg_database SET datistemplate = false WHERE datname = 'template1';
>
> DROPDB -U postgres template1
>
> CREATEDB -U postgres -T template0 template1
>
> UPDATE pg_database SET datistemplate = true WHERE datname = 'template1';
> GRANT CONNECT ON DATABASE template1 TO public;
> GRANT ALL ON DATABASE template1 TO postgres;
> COMMENT ON DATABASE template1 IS 'default template database';
>
> However, when I view the properties of the new template1 in pgAdmin III it
> isn't stated that it's a system database anymore. Is it because that the
> OID is different from 1 or is there a hidden flag? In pg_database I don't
> see any significant difference from other servers' template1?
>
> Could you tell me, please?
>

Because of the OID.


--
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: system database flag?

From
Jan-Peter.Seifert@gmx.de
Date:
Hello, 

Guillaume Lelarge wrote:

> > However, when I view the properties of the new template1 in pgAdmin III
> it
> > isn't stated that it's a system database anymore. Is it because that the
> > OID is different from 1 or is there a hidden flag? In pg_database I
> don't
> > see any significant difference from other servers' template1?
> >
> > Could you tell me, please?
> 
> Because of the OID.

Thank you very much for your quick reply. So there are no other 'glitches' or problems if recreating template1? I guess
there'sno way and it's not adviseable to change the OID back to 1?
 

Thank you very much,

Peter

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!*
http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a


Re: system database flag?

From
Guillaume Lelarge
Date:
Le jeudi 23 avril 2009 à 14:48:29, Jan-Peter.Seifert@gmx.de a écrit :
> Hello,
>
> Guillaume Lelarge wrote:
> > > However, when I view the properties of the new template1 in pgAdmin III
> >
> > it
> >
> > > isn't stated that it's a system database anymore. Is it because that
> > > the OID is different from 1 or is there a hidden flag? In pg_database I
> >
> > don't
> >
> > > see any significant difference from other servers' template1?
> > >
> > > Could you tell me, please?
> >
> > Because of the OID.
>
> Thank you very much for your quick reply. So there are no other 'glitches'
> or problems if recreating template1?

None that I know.

> I guess there's no way and it's not
> adviseable to change the OID back to 1?
>

I don't think it is adviseable. The only issue in pgAdmin will be to have this
catalog in the schemas node. I'm not sure this is really a big deal.


--
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com