Re: Modifying pg_shadow?

From: Jason Hihn <jhihn(at)paytimepayroll(dot)com>
To: Oliver Fromme <olli(at)lurza(dot)secnetix(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Modifying pg_shadow?
Date: 2003-09-09 13:57:09
Message-ID: NGBBLHANMLKMHPDGJGAPGENBCMAA.jhihn@paytimepayroll.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> -----Original Message-----
> From: Oliver Fromme [mailto:olli(at)lurza(dot)secnetix(dot)de]
> Sent: Tuesday, September 09, 2003 9:37 AM
> To: Jason Hihn
> Cc: Tom Lane; pgsql-novice(at)postgresql(dot)org
> Subject: Re: [NOVICE] Modifying pg_shadow?
>
>
>
> Jason Hihn wrote:
> > Tom Lane wrote:
> >
> > > > How do I back up the pg_ system tables?
> > >
> > > They aren't backed up as such; all the useful content is
> included in the
> > > schema information output by pg_dump or pg_dumpall.
> >
> > What database name should pg_dump be given? This is a horrid
> omission from
> > the online docs! Furthermore, there is also no system database
> listed in
> > pg_database.
>
> I think "pg_dumpall -g" is what you want. That _is_ in the
> online docs.

> However, I agree that restoring a complete PG cluster from
> scratch seems to be somewhat difficult. You still have to
> do a lot of things manually in order to get everything right
> without missing anything. At least that's my impression.
>
"Chapter 9. Backup and Restore":
pg_dump dbname > outfile

What's the dbname for the system tables? The -g option of pg_dumpall only
does users and groups. No other tables. (Eek!)

>
> I think you might want to look at the relacl column of the
> pg_class table.

Ah, wonderful. This is what I was looking for. Though in the past I've used
databases where I wouldn't have to parse this text. It was quite easy and
fun to work with as tuple data. *wink*

Ok, so I have a question If I have 2 databases, a and b, and they both have
a table, c, how do I grant permissions only to table a.t and not both tables
in both databases at the same time? The intituve answer is not correct -
that 'ON a.t ...' does not work.

> However, in your case, it might be beneficial to store the
> data about users in your own database, in a format which is
> suitable for your use. You can then generate grant/revoke
> commands from that if necessary. It would also be a lot
> more portable than depending on the internal structure of
> PG system tables.

I really don't want to have to re-invent the wheel here.

Thank you for your help, I'm headed in the right direction now.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruce Momjian 2003-09-09 13:59:15 Re: Modifying pg_shadow?
Previous Message Oliver Fromme 2003-09-09 13:36:42 Re: Modifying pg_shadow?