Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-17 Thread Bruce Momjian
Christopher Kings-Lynne wrote: > >>What I would like to see is some builtin functions that give me the > >>table's DDL, just as pg_dump does. Extra nice would be complementary > >>functions that also give me skeleton select statements for each table or > >>view. > > > > > > Yeah, what I first

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-14 Thread Christopher Kings-Lynne
There were quite some proposals about additional triggers (on connect/disconnnect) around, I wonder if some kind of schema/database-level trigger could be used for DDL logging. Or, "global triggers" where you can have a trigger that is executed upon ANY DML or DDL... Chris

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-14 Thread Christopher Kings-Lynne
What I would like to see is some builtin functions that give me the table's DDL, just as pg_dump does. Extra nice would be complementary functions that also give me skeleton select statements for each table or view. Yeah, what I first thought David was proposing was a consolidated view simila

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-14 Thread Andreas Pflug
Tom Lane wrote: David Fetter <[EMAIL PROTECTED]> writes: On Tue, Dec 13, 2005 at 11:33:20PM -0500, Tom Lane wrote: and I don't even see the argument for doing it via a table rather than via the postmaster log. Simple. Postmaster logs can roll over or otherwise be lost without damaging th

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-14 Thread Richard Huxton
Tom Lane wrote: David Fetter <[EMAIL PROTECTED]> writes: On Tue, Dec 13, 2005 at 11:33:20PM -0500, Tom Lane wrote: and I don't even see the argument for doing it via a table rather than via the postmaster log. Simple. Postmaster logs can roll over or otherwise be lost without damaging the D

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-14 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > What I would like to see is some builtin functions that give me the > table's DDL, just as pg_dump does. Extra nice would be complementary > functions that also give me skeleton select statements for each table or > view. Yeah, what I first thought D

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-14 Thread Andrew Dunstan
Tom Lane wrote: Simple. Postmaster logs can roll over or otherwise be lost without damaging the DB. This would provide a non-volatile log of DDLs. In that case you have to provide a pretty strong argument why everyone should be forced to have a non-volatile log of DDLs. Conve

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-14 Thread Tom Lane
David Fetter <[EMAIL PROTECTED]> writes: > On Tue, Dec 13, 2005 at 11:33:20PM -0500, Tom Lane wrote: >> and I don't even see the argument for doing it via a table rather >> than via the postmaster log. > Simple. Postmaster logs can roll over or otherwise be lost without > damaging the DB. This w

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-13 Thread David Fetter
On Tue, Dec 13, 2005 at 11:33:20PM -0500, Tom Lane wrote: > David Fetter <[EMAIL PROTECTED]> writes: > > The idea is to make a new table in pg_catalog called pg_ddl. > > This seems rather poorly thought out --- I can't even tell whether > your intention is to make a log of past operations, Yes.

Re: [HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-13 Thread Tom Lane
David Fetter <[EMAIL PROTECTED]> writes: > The idea is to make a new table in pg_catalog called pg_ddl. This seems rather poorly thought out --- I can't even tell whether your intention is to make a log of past operations, or to provide a uniform way to extract the current definition of every obje

[HACKERS] Immodest Proposal: pg_catalog.pg_ddl

2005-12-13 Thread David Fetter
Folks, I've been looking into ways to have a better idea--automatically--of what's been going on in a database from a DDL level, and here's what I've come up with so far. I'd much appreciate hearing suggestions and/or brickbats on this. The idea is to make a new table in pg_catalog called pg_ddl