Re: Permissions problem with sequences

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Gary Doades <gpd(at)gpdnet(dot)co(dot)uk>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Permissions problem with sequences
Date: 2004-09-07 03:41:48
Message-ID: 24737.1094528508@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
>> Given that pg_dump does put out GRANT/REVOKE operations on the sequence,
>> it's certainly aware that the sequence exists. I suspect this is just a
>> fixable bug (ie, suppression of output of the sequence CREATE command is
>> being done at the wrong place).

> I'm trying to think of the solution here.

One way is to allow the ArchiveEntry to be created (ie, suppress the
discrimination against owned sequences at pg_dump.c:7306) and instead
discriminate at the point of emitting the CREATE or DROP from the
ArchiveEntry ... but not when emitting an ALTER OWNER from it.

That does seem a bit ugly though. What about emitting only an ACL
ArchiveEntry instead of a full ArchiveEntry for an owned sequence?

Actually ... given that pg_dump.c:7306 is suppressing the ArchiveEntry
... where the heck are the GRANT/REVOKE outputs coming from? I thought
those were generated off an ArchiveEntry but apparently not. It's too
late at night here for me to feel like tracking this down, but it seems
an important part of the puzzle.

Ultimately I think this one comes down to taste --- do what seems least
ugly ...

> Also, are there any other objects that are going to have this problem?
> Off the top of my head it's only serial sequences.

Can't think of any others ATM. If more come up, we'll need to invent
some infrastructure to support it --- more fields in an ArchiveEntry,
say. That is also a possible solution right now, but I'm not sure it's
worth the trouble as long as there's only one use-case. Again it boils
down to your design taste ...

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PostgreSQL Bugs List 2004-09-07 07:57:14 BUG #1242: Major bug in pgSQL
Previous Message Christopher Kings-Lynne 2004-09-07 03:04:56 Re: Permissions problem with sequences