Re: Permissions problem with sequences - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Permissions problem with sequences
Date
Msg-id 24737.1094528508@sss.pgh.pa.us
Whole thread Raw
In response to Permissions problem with sequences  ("Gary Doades" <gpd@gpdnet.co.uk>)
Responses Re: Permissions problem with sequences  (Michael Fuhr <mike@fuhr.org>)
List pgsql-bugs
Christopher Kings-Lynne <chriskl@familyhealth.com.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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] [pgsql-hackers-win32] Win32 deadlock detection not working for Postgres8beta1
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1242: Major bug in pgSQL