![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a problem with permissions on sequences when restored to another PC. |
#3
| |||
| |||
|
|
"Gary Doades" <gpd (AT) gpdnet (DOT) co.uk> writes: I have a problem with permissions on sequences when restored to another PC. This is not a dump/restore bug, because in fact you would have had the same behavior before dumping. You never granted permissions on the c1 sequence to user1_test in the first place. |
#4
| |||
| |||
|
|
"Gary Doades" <gpd (AT) gpdnet (DOT) co.uk> writes: I have a problem with permissions on sequences when restored to another PC. This is not a dump/restore bug, because in fact you would have had the same behavior before dumping. You never granted permissions on the c1 sequence to user1_test in the first place. |
#5
| |||
| |||
|
|
There is, however, an ownership problem with restoring sequences in 8.0.0beta. In 7.4.5, for example, pg_dump issues a SET SESSION AUTHORIZATION command and then creates a table, so implicitly-created sequences are restored with the correct ownership. In 8.0.0beta2, however, pg_dump doesn't issue SET SESSION AUTHORIZATION but rather creates a table and then issues ALTER TABLE ... OWNER TO. |
#6
| |||
| |||
|
|
However, of course the best thing is to just fix it, which I guess I'll have a crack at... |
#7
| |||
| |||
|
|
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. |
|
Also, are there any other objects that are going to have this problem? Off the top of my head it's only serial sequences. |
#8
| |||
| |||
|
|
Christopher Kings-Lynne <chriskl (AT) familyhealth (DOT) 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. |
#9
| |||
| |||
|
|
... DROP TABLE cascades to implictly-created sequences -- why shouldn't ALTER TABLE OWNER TO cascade as well? |
#10
| |||
| |||
|
|
Hmm ... I hadn't thought of that approach, but it seems pretty reasonable offhand ... comments? What if they change the owner of the serial sequence independently anyway? |
![]() |
| Thread Tools | |
| Display Modes | |
| |