Re: Details for planned template0/template1 change - Mailing list pgsql-hackers

From Philip Warner
Subject Re: Details for planned template0/template1 change
Date
Msg-id 3.0.5.32.20001115155938.03562950@mail.rhyme.com.au
Whole thread Raw
In response to Re: Details for planned template0/template1 change  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Details for planned template0/template1 change  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
At 23:48 14/11/00 -0500, Tom Lane wrote:
>Philip Warner <pjw@rhyme.com.au> writes:
>>> Given the present backend coding, all the DBs in an installation will
>>> have the same lastsysoid as template0 anyway, barring manual
>>> intervention.
>
>> Not the way the current 'CREATE DATABASE' code works - remember the changes
>> to set the OID at create time? AFAICT, that's still there.
>
>Look again.  lastsysoid is now inherited from the database being cloned.

It looks to me like that was the intent of the code; but there is still:
       tuple = heap_formtuple(pg_database_dsc, new_record, new_record_nulls);
       tuple->t_data->t_oid = dboid;   /* override heap_insert's OID
selection */
       heap_insert(pg_database_rel, tuple);

which I think stuffs up everything, since dboid was allocated earlier in
the same call. But I agree, the code looks like it tries to do what you said.

I could have missed something, though.


>AFAICT all your subsequent comments are based on that
>misunderstanding...

Pretty much. Sorry. Is there a smiley for embarrasment?


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Details for planned template0/template1 change
Next
From: Philip Warner
Date:
Subject: Re: Details for planned template0/template1 change