- Notifications
You must be signed in to change notification settings - Fork5
Commit2b2a507
committed
Fix all known problems with pg_dump's handling of serial sequences
by abandoning the idea that it should say SERIAL in the dump. Instead,dump serial sequences and column defaults just like regular ones.Add a new backend command ALTER SEQUENCE OWNED BY to let pg_dump recreatethe sequence-to-column dependency that was formerly created "behind thescenes" by SERIAL. This restores SERIAL to being truly "just a macro"consisting of component operations that can be stated explicitly in SQL.Furthermore, the new command allows sequence ownership to be reassigned,so that old mistakes can be cleaned up.Also, downgrade the OWNED-BY dependency from INTERNAL to AUTO, since thereis no longer any very compelling argument why the sequence couldn't bedropped while keeping the column. (This forces initdb, to be sure theright kinds of dependencies are in there.)Along the way, add checks to prevent ALTER OWNER or SET SCHEMA on anowned sequence; you can now only do this indirectly by changing theowning table's owner or schema. This is an oversight in previousreleases, but probably not worth back-patching.1 parentdf18c51 commit2b2a507
File tree
29 files changed
+590
-356
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- nodes
- parser
- utils/adt
- bin/pg_dump
- include
- catalog
- nodes
- test/regress
- expected
- sql
29 files changed
+590
-356
lines changedLines changed: 9 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
705 | 705 |
| |
706 | 706 |
| |
707 | 707 |
| |
708 |
| - | |
| 708 | + | |
709 | 709 |
| |
| 710 | + | |
710 | 711 |
| |
711 | 712 |
| |
712 | 713 |
| |
713 | 714 |
| |
714 | 715 |
| |
715 |
| - | |
| 716 | + | |
716 | 717 |
| |
717 | 718 |
| |
718 |
| - | |
| 719 | + | |
| 720 | + | |
719 | 721 |
| |
720 | 722 |
| |
721 | 723 |
| |
| |||
749 | 751 |
| |
750 | 752 |
| |
751 | 753 |
| |
752 |
| - | |
753 |
| - | |
754 |
| - | |
755 |
| - | |
756 |
| - | |
757 |
| - | |
758 |
| - | |
759 |
| - | |
760 |
| - | |
761 |
| - | |
762 |
| - | |
763 |
| - | |
764 |
| - | |
765 |
| - | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
766 | 757 |
| |
767 | 758 |
| |
768 | 759 |
| |
|
Lines changed: 9 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
9863 | 9863 |
| |
9864 | 9864 |
| |
9865 | 9865 |
| |
9866 |
| - | |
9867 |
| - | |
9868 |
| - | |
9869 |
| - | |
| 9866 | + | |
| 9867 | + | |
| 9868 | + | |
| 9869 | + | |
| 9870 | + | |
| 9871 | + | |
| 9872 | + | |
| 9873 | + | |
9870 | 9874 |
| |
9871 | 9875 |
| |
9872 | 9876 |
| |
|
Lines changed: 39 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
| |||
163 | 164 |
| |
164 | 165 |
| |
165 | 166 |
| |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
166 | 185 |
| |
167 | 186 |
| |
168 | 187 |
| |
| |||
191 | 210 |
| |
192 | 211 |
| |
193 | 212 |
| |
194 |
| - | |
195 |
| - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
196 | 218 |
| |
197 | 219 |
| |
198 | 220 |
| |
199 | 221 |
| |
200 | 222 |
| |
201 | 223 |
| |
202 | 224 |
| |
203 |
| - | |
| 225 | + | |
| 226 | + | |
204 | 227 |
| |
205 | 228 |
| |
206 | 229 |
| |
| |||
217 | 240 |
| |
218 | 241 |
| |
219 | 242 |
| |
220 |
| - | |
221 |
| - | |
| 243 | + | |
| 244 | + | |
222 | 245 |
| |
223 | 246 |
| |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
224 | 257 |
| |
225 | 258 |
| |
226 | 259 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
371 | 371 |
| |
372 | 372 |
| |
373 | 373 |
| |
374 |
| - | |
| 374 | + | |
375 | 375 |
| |
376 | 376 |
| |
377 | 377 |
| |
|
Lines changed: 47 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
193 | 194 |
| |
194 | 195 |
| |
195 | 196 |
| |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
196 | 213 |
| |
197 | 214 |
| |
198 | 215 |
| |
| |||
300 | 317 |
| |
301 | 318 |
| |
302 | 319 |
| |
303 |
| - | |
304 |
| - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
305 | 339 |
| |
306 | 340 |
| |
307 | 341 |
| |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
308 | 352 |
| |
309 | 353 |
| |
310 | 354 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
| 108 | + | |
108 | 109 |
| |
109 | 110 |
| |
110 | 111 |
| |
|
0 commit comments
Comments
(0)