Re: Modifying pg_shadow?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jason Hihn <jhihn(at)paytimepayroll(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Modifying pg_shadow?
Date: 2003-09-09 13:59:15
Message-ID: 200309091359.h89DxFZ08275@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Jason Hihn wrote:
>
>
> > -----Original Message-----
> > From: pgsql-novice-owner(at)postgresql(dot)org
> > [mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of Tom Lane
> > Sent: Monday, September 08, 2003 4:48 PM
> > To: Jason Hihn
> > Cc: pgsql-novice(at)postgresql(dot)org
> > Subject: Re: [NOVICE] Modifying pg_shadow?
> >
> >
> > Jason Hihn <jhihn(at)paytimepayroll(dot)com> writes:
> > > I wish to track some additional info about users. Can I just
> > add columns to
> > > the pg_shadow table?
> >
> > Not without modifying the C code that manipulates pg_shadow (at the very
> > least, some routines in src/backend/commands/user.c would have to
> > change, and you'd need to update src/include/catalog/pg_shadow.h).
>
>
> If I could write code to handle tables with extra columns, can't the
> back-end do it too? It would be poetic to have the backend process itself
> with itself. (It appears you hard code these tables?) Not to mention
> extremely flexible.

We do use PostgreSQL to process itself. There is the bootstrap problem
of how to start things.

> > > Can I add a system table while I am at it? (how?)
> >
> > What's your idea of a "system table"? Mine is one that some C code in
> > the backend knows about explicitly. Unless you've written some C code
> > that accesses a table, it's not a system table. The infrastructure for
> > doing this is at least a header in include/catalog/, usually more
> > depending on whether you need things like cache support for the new
> > table. You might care to look at all the code referencing one of the
> > lesser-used catalogs, perhaps pg_language or pg_cast, to get a sense of
> > what is involved.
>
> A 'system table' to me is one provided by Postgres. It is the set of tables
> that exist with no user databases and user tables.

Just put the table in template1 and it will be added to every database
you create.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2003-09-09 14:59:47 Re: How to insert non-english characters to the db?
Previous Message Jason Hihn 2003-09-09 13:57:09 Re: Modifying pg_shadow?