Re: Details for planned template0/template1 change

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Details for planned template0/template1 change
Date: 2000-11-13 17:28:04
Message-ID: 3.0.5.32.20001114042804.033d98e0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 11:48 13/11/00 -0500, Tom Lane wrote:
>
>5. pg_dump should ignore objects with OID <= lastsysoid of the target
> database.

I think it should ignore objects with OID <= lastsysoid of template0; then
when it does a restore, it should use 'WITH TEMPLATE template0'. At least
this should be an option.

>I think that
>a dballowconn flag might have other uses anyway, such as temporarily
>disallowing new connections to a database you are doing major work in.

eg. while a restore script is running...

BTW: are there any nice ways to:

- set the flag
- kick current users off without corrupting memory

(ie. shutdown a single database).

>lastsysoid will probably always be the same for all databases in an
>installation, since they'll all inherit the value from template0 or
>template1. However, there is the possibility of changing it to exclude
>some items from backup, so I'm continuing to treat it as a per-database
>value.

Sounds fine; but we need to use lastsysoid of template0 in pg_dump. Consider:

- add function foo() to template1, OID=100000
- create db1 (inherits foo())
- update function foo() in template1, and also update it in db1. New OID >
100000
- dump db1 - will dump foo().
- restore db1 using template1->crash

However, dumping based oi lastsysoid of template0, then restoring based on
template0 works...

Otherwise sounds good!

----------------------------------------------------------------
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 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-11-13 17:33:52 Re: UUNET socket-file-location patch
Previous Message Tom Lane 2000-11-13 17:22:09 Re: Details for planned template0/template1 change