PostgreSQL Source Code: src/backend/catalog/dependency.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
16
85#include "utils/fmgroids.h"
88
89
90
91
92
93
94
100
101
102#define DEPFLAG_ORIGINAL 0x0001
103#define DEPFLAG_NORMAL 0x0002
104#define DEPFLAG_AUTO 0x0004
105#define DEPFLAG_INTERNAL 0x0008
106#define DEPFLAG_PARTITION 0x0010
107#define DEPFLAG_EXTENSION 0x0020
108#define DEPFLAG_REVERSE 0x0040
109#define DEPFLAG_IS_PART 0x0080
110#define DEPFLAG_SUBOBJECT 0x0100
111
112
113
121
122
123
124
131
132
138
139
145
146
179
180
181
182
183
184
185static void
188{
189 int i;
190
191
192
193
195 {
197 {
200 bool original = false;
201 bool normal = false;
202
204 original = true;
206 normal = true;
208 normal = true;
209
211 {
213 }
214 }
215 }
216
217
218
219
220
222 {
225
228 continue;
229
231 }
232}
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273void
276{
279
280
281
282
283
285
286
287
288
289
291
292
293
294
295
297
301 NULL,
303 NULL,
305
306
307
308
310 behavior,
312 object);
313
314
316
317
319
321}
322
323
324
325
326
327
328
329
330
331
332void
335{
338
340
342
344
345
346
347
348
350
354 NULL,
356 NULL,
358
359
360
361
363 behavior,
365 object);
366
367
369
371}
372
373
374
375
376
377
378
379
380
381
382void
385{
388 int i;
389
390
391 if (objects->numrefs <= 0)
392 return;
393
394
395
396
397
399
400
401
402
403
404
405
406
407
409
410 for (i = 0; i < objects->numrefs; i++)
411 {
413
414
415
416
417
419
423 NULL,
425 objects,
427 }
428
429
430
431
432
433
434
436 behavior,
439
440
442
443
445
447}
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482static void
490{
492 int nkeys;
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
521 return;
522
523
524
525
526
528
529
530
531
532
533
534
535
536
537
539 return;
540
541
542
543
544
548 errmsg("cannot drop %s because it is required by the database system",
550
551
552
553
554
555
556
557
558
559
560
570 {
571
576 nkeys = 3;
577 }
578 else
579 {
580
581 nkeys = 2;
582 }
583
585 NULL, nkeys, key);
586
587
590
592 {
594
598
599
600
601
602
603
604
605
609 continue;
610
612 {
616
617 break;
618
620
621
622
623
624
625
626
628 break;
629
630
631
632
633
634
635
636
637
641 break;
642
643
645
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665 if (stack == NULL)
666 {
669 {
671
673 return;
674 }
675
676
677
678
679
680
681
682
683
684
685
689 break;
690 }
691
692
693
694
695
696
697
698
699
701 break;
702
703
704
705
706
707
708
709
710
711
712
715
716
717
718
719
720
721
723 {
726 return;
727 }
728
729
730
731
732
733
735
736
737
738
739
740
741
742
743
744
745
746
750 stack,
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
773 elog(ERROR, "deletion of owning object %s failed to delete %s",
776
777
778 return;
779
781
782
783
784
785
786
788
789
790
791
792
793
795 break;
796
798
799
800
801
802
805
806
807
808
809
810
812 break;
813
814 default:
815 elog(ERROR, "unrecognized dependency type '%c' for %s",
817 break;
818 }
819 }
820
822
823
824
825
826
827
828
830 {
832
835 else
837
840 errmsg("cannot drop %s because %s requires it",
843 }
844
845
846
847
848
849
850
851
852
856
866 {
871 nkeys = 3;
872 }
873 else
874 nkeys = 2;
875
877 NULL, nkeys, key);
878
880 {
882 int subflags;
883
887
888
889
890
891
892
896 continue;
897
898
899
900
901
905 errmsg("cannot drop %s because %s depends on it",
908
909
910
911
913
914
915
916
917
918
919
920
922 {
923
925
926 continue;
927 }
928
929
930
931
932
934 {
937 break;
941 break;
944 break;
948 break;
951 break;
952 default:
953 elog(ERROR, "unrecognized dependency type '%c' for %s",
955 subflags = 0;
956 break;
957 }
958
959
961 {
962
967 }
968
972 }
973
975
976
977
978
979
980
985
986
987
988
989
993
995 {
997
1005 }
1006
1008
1009
1010
1011
1012
1013
1014
1015
1016
1020 else if (stack)
1022 else
1025}
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040static void
1045{
1047 bool ok = true;
1052 int i;
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1065 {
1067
1070 {
1073 false);
1074
1077 errmsg("cannot drop %s because %s requires it",
1080 }
1081 }
1082
1083
1084
1085
1086
1087
1090 return;
1091
1092
1093
1094
1095
1096
1097#define MAX_REPORTED_DEPS 100
1098
1101
1102
1103
1104
1105
1107 {
1111
1112
1114 continue;
1115
1116
1118 continue;
1119
1121
1122
1124 continue;
1125
1126
1127
1128
1129
1130
1135 {
1136
1137
1138
1139
1140
1141
1145 }
1147 {
1149 false);
1150
1152 {
1154 {
1155
1161 }
1162 else
1164
1165 if (logdetail.len != 0)
1170 }
1171 else
1173 ok = false;
1174 }
1175 else
1176 {
1178 {
1179
1185 }
1186 else
1188
1189 if (logdetail.len != 0)
1193 }
1194
1196 }
1197
1200 "(see server log for list)",
1201 "\nand %d other objects "
1202 "(see server log for list)",
1205
1206 if ()
1207 {
1211 errmsg("cannot drop %s because other objects depend on it",
1215 errhint("Use DROP ... CASCADE to drop the dependent objects too.")));
1216 else
1219 errmsg("cannot drop desired object(s) because other objects depend on them"),
1222 errhint("Use DROP ... CASCADE to drop the dependent objects too.")));
1223 }
1225 {
1227 (errmsg_plural("drop cascades to %d other object",
1228 "drop cascades to %d other objects",
1233 }
1235 {
1236
1239 }
1240
1243}
1244
1245
1246
1247
1248
1249static void
1251{
1255
1257
1259
1260
1261
1262
1263 if (cacheId >= 0)
1264 {
1267 elog(ERROR, "cache lookup failed for %s %u",
1269
1271
1273 }
1274 else
1275 {
1278
1283
1286
1287
1290 elog(ERROR, "could not find tuple for %s %u",
1292
1294
1296 }
1297
1299}
1300
1301
1302
1303
1304
1305
1306static void
1308{
1310 int nkeys;
1313
1314
1317
1318
1319
1320
1321
1322
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1336
1337
1338
1339
1342
1343
1344
1345
1346
1347
1348
1349
1359 {
1364 nkeys = 3;
1365 }
1366 else
1367 nkeys = 2;
1368
1370 NULL, nkeys, key);
1371
1373 {
1375 }
1376
1378
1379
1380
1381
1382
1385
1386
1387
1388
1389
1390
1391
1392
1393
1397
1398
1399
1400
1401
1403
1404
1405
1406
1407}
1408
1409
1410
1411
1412static void
1414{
1416 {
1418 {
1420
1423 {
1426
1429 }
1430 else
1431 {
1435 else
1437 }
1438
1439
1440
1441
1442
1445 break;
1446 }
1447
1450 break;
1451
1454 break;
1455
1458 break;
1459
1462 break;
1463
1466 break;
1467
1470 break;
1471
1474 break;
1475
1478 break;
1479
1482 break;
1483
1486 break;
1487
1490 break;
1491
1494 break;
1495
1498 break;
1499
1502 break;
1503
1506 break;
1507
1529 break;
1530
1531
1532
1533
1539 elog(ERROR, "global objects cannot be deleted by doDeletion");
1540 break;
1541
1542 default:
1544 }
1545}
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556void
1558{
1560 {
1561
1562
1563
1564
1565
1566
1569 else
1571 }
1575 else
1576 {
1577
1580 }
1581}
1582
1583
1584
1585
1586
1587
1588void
1590{
1593 else
1594
1597}
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613void
1617{
1619
1621
1622
1624
1625
1627
1628
1631 behavior);
1632
1634}
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656void
1659{
1661
1662 context.addrs = addrs;
1663
1664
1666
1667
1669}
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688void
1694{
1697
1699
1700
1703 rte.relid = relId;
1706
1708
1709
1711
1712
1714
1715
1718 {
1723
1725
1729 {
1731
1733 thisobj->objectId == relId)
1734 {
1735
1737 }
1738 else
1739 {
1740
1744 }
1745 }
1747
1748
1753 else
1754 {
1755
1757
1759 {
1761
1763 }
1764 }
1765
1767 }
1768
1769
1772 behavior);
1773
1775}
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790static bool
1793{
1794 if (node == NULL)
1795 return false;
1797 {
1799 List *rtable;
1801
1802
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1822 return false;
1824 {
1825
1827 context->addrs);
1828 }
1830 {
1831
1832
1834 }
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844 return false;
1845 }
1847 {
1849 Oid objoid;
1850
1851
1853 context->addrs);
1854
1855
1856
1857
1858
1859
1860
1864 context->addrs);
1865
1866
1867
1868
1869
1870
1871
1872 if (!con->constisnull)
1873 {
1875 {
1882 context->addrs);
1883 break;
1890 context->addrs);
1891 break;
1897 context->addrs);
1898 break;
1904 context->addrs);
1905 break;
1911 context->addrs);
1912 break;
1918 context->addrs);
1919 break;
1925 context->addrs);
1926 break;
1927
1933 context->addrs);
1934 break;
1935
1936
1937
1938
1939
1943 errmsg("constant of the type %s cannot be used here",
1944 "regrole")));
1945 break;
1946
1947
1948
1949
1950
1954 errmsg("constant of the type %s cannot be used here",
1955 "regdatabase")));
1956 break;
1957 }
1958 }
1959 return false;
1960 }
1962 {
1964
1965
1967 context->addrs);
1968
1972 context->addrs);
1973 }
1975 {
1977
1979 context->addrs);
1980
1981 }
1983 {
1985
1987 context->addrs);
1988
1989 }
1991 {
1993
1995 context->addrs);
1996
1997 }
1999 {
2001
2003 context->addrs);
2004
2005 }
2007 {
2009
2011 context->addrs);
2012
2013 }
2015 {
2017
2019 context->addrs);
2020
2021 }
2023 {
2025
2027 context->addrs);
2028
2029 }
2031 {
2033
2034
2035
2036
2037
2038
2039
2040 if (sbsref->refrestype != sbsref->refcontainertype &&
2041 sbsref->refrestype != sbsref->refelemtype)
2043 context->addrs);
2044
2045 }
2047 {
2048
2049 elog(ERROR, "already-planned subqueries not supported");
2050 }
2052 {
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2068 context->addrs);
2069 else
2071 context->addrs);
2072
2076 context->addrs);
2077 }
2079 {
2082
2083
2085 {
2087
2088 foreach(l, fstore->fieldnums)
2090 context->addrs);
2091 }
2092 else
2094 context->addrs);
2095 }
2097 {
2099
2100
2102 context->addrs);
2103
2107 context->addrs);
2108 }
2110 {
2112
2113
2115 context->addrs);
2116
2117 if (OidIsValid(iocoerce->resultcollid) &&
2120 context->addrs);
2121 }
2123 {
2125
2126
2128 context->addrs);
2129
2133 context->addrs);
2134
2135 }
2137 {
2139
2140
2142 context->addrs);
2143 }
2145 {
2147
2149 context->addrs);
2150 }
2152 {
2154
2156 context->addrs);
2157 }
2159 {
2162
2163 foreach(l, rcexpr->opnos)
2164 {
2166 context->addrs);
2167 }
2168 foreach(l, rcexpr->opfamilies)
2169 {
2171 context->addrs);
2172 }
2173
2174 }
2176 {
2178
2180 context->addrs);
2181 }
2183 {
2185
2187 context->addrs);
2188 }
2190 {
2192
2195 context->addrs);
2196
2197 }
2199 {
2201
2203 context->addrs);
2206 context->addrs);
2207 return false;
2208 }
2210 {
2212
2213 if (OidIsValid(wc->startInRangeFunc))
2215 context->addrs);
2218 context->addrs);
2222 context->addrs);
2223
2224 }
2226 {
2228
2231 context->addrs);
2234 context->addrs);
2237 context->addrs);
2238
2239 }
2241 {
2242
2245 bool result;
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2264 {
2266
2267 switch (rte->rtekind)
2268 {
2271 context->addrs);
2272 break;
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2289 for (int i = 0; i < rte->joinmergedcols; i++)
2290 {
2292
2295 }
2297 break;
2299
2300
2301
2302
2303
2304
2305
2306
2309 errmsg("transition table \"%s\" cannot be referenced in a persistent object",
2310 rte->eref->aliasname)));
2311 break;
2312 default:
2313
2314 break;
2315 }
2316 }
2317
2318
2319
2320
2321
2322
2323
2324
2327 {
2329
2330 if (query->resultRelation <= 0 ||
2332 elog(ERROR, "invalid resultRelation %d",
2333 query->resultRelation);
2336 {
2338 {
2340
2341 if (tle->resjunk)
2342 continue;
2344 context->addrs);
2345 }
2346 }
2347 }
2348
2349
2350
2351
2352 foreach(lc, query->constraintDeps)
2353 {
2355 context->addrs);
2356 }
2357
2358
2362 context,
2366 return result;
2367 }
2369 {
2371
2372
2374
2375 }
2377 {
2380
2381
2382
2383
2384
2385
2386 foreach(ct, rtfunc->funccoltypes)
2387 {
2389 context->addrs);
2390 }
2391 foreach(ct, rtfunc->funccolcollations)
2392 {
2394
2397 context->addrs);
2398 }
2399 }
2401 {
2404
2405
2406
2407
2408 foreach(ct, tf->coltypes)
2409 {
2411 context->addrs);
2412 }
2413 foreach(ct, tf->colcollations)
2414 {
2416
2419 context->addrs);
2420 }
2421 }
2423 {
2425
2427 context->addrs);
2428
2429 }
2430
2432 context);
2433}
2434
2435
2436
2437
2438
2439static void
2442{
2445
2446
2447
2448
2449
2450
2451
2452 foreach(lc, rte->functions)
2453 {
2455
2458 {
2460
2461
2462 if (rtfunc->funccolnames != NIL)
2463 tupdesc = NULL;
2464 else
2467 {
2468
2469
2470
2471
2473
2475 if (OidIsValid(reltype))
2478 context->addrs);
2479 return;
2480 }
2481
2482 return;
2483 }
2484 atts_done += rtfunc->funccolcount;
2485 }
2486
2487
2489 return;
2490
2491
2494 errmsg("column %d of relation \"%s\" does not exist",
2495 attnum, rte->eref->aliasname)));
2496}
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513bool
2516{
2517 for (int i = 0; i < addrs->numrefs; i++)
2518 {
2521
2522
2523
2524
2525
2527
2528
2529
2530
2531
2534 {
2536 return true;
2537 }
2538 }
2539 return false;
2540}
2541
2542
2543
2544
2545
2546
2547
2548bool
2550{
2551 bool result;
2553
2555
2556
2558
2559
2561
2563
2564 return result;
2565}
2566
2567
2568
2569
2570static void
2572{
2576
2577
2578
2579
2580
2581
2583
2584 if (addrs->numrefs <= 1)
2585 return;
2586
2587
2590
2591
2595 {
2597
2600 {
2602 continue;
2603
2604
2605
2606
2607
2608
2609
2610
2611 if (priorobj->objectSubId == 0)
2612 {
2613
2615 continue;
2616 }
2617 }
2618
2622 }
2623
2625}
2626
2627
2628
2629
2630static int
2632{
2635
2636
2637
2638
2639
2640
2641 if (obja->objectId > objb->objectId)
2642 return -1;
2643 if (obja->objectId < objb->objectId)
2644 return 1;
2645
2646
2647
2648
2649
2650 if (obja->classId < objb->classId)
2651 return -1;
2652 if (obja->classId > objb->classId)
2653 return 1;
2654
2655
2656
2657
2658
2659
2660
2661
2662 if ((unsigned int) obja->objectSubId < (unsigned int) objb->objectSubId)
2663 return -1;
2664 if ((unsigned int) obja->objectSubId > (unsigned int) objb->objectSubId)
2665 return 1;
2666 return 0;
2667}
2668
2669
2670
2671
2672
2673
2676{
2678
2680
2685
2686 return addrs;
2687}
2688
2689
2690
2691
2692static void
2695{
2697
2698
2700 {
2705 }
2706
2708 item->classId = classId;
2712}
2713
2714
2715
2716
2717
2718
2719void
2722{
2724
2725
2727 {
2732 }
2733
2737}
2738
2739
2740
2741
2742
2743
2744static void
2748{
2751
2752
2756
2757
2759 {
2765 }
2766
2772}
2773
2774
2775
2776
2777
2778
2779bool
2782{
2783 int i;
2784
2785 for (i = addrs->numrefs - 1; i >= 0; i--)
2786 {
2788
2791 {
2793 thisobj->objectSubId == 0)
2794 return true;
2795 }
2796 }
2797
2798 return false;
2799}
2800
2801
2802
2803
2804
2805static bool
2809{
2810 bool result = false;
2811 int i;
2812
2813 for (i = addrs->numrefs - 1; i >= 0; i--)
2814 {
2816
2819 {
2821 {
2823
2825 result = true;
2826 }
2827 else if (thisobj->objectSubId == 0)
2828 {
2829
2830
2831
2832
2833
2834
2835
2836 result = true;
2837 }
2839 {
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2865
2868 }
2869 }
2870 }
2871
2872 return result;
2873}
2874
2875
2876
2877
2878static bool
2882{
2883 bool result = false;
2885
2887 {
2889
2892 {
2894 {
2896 result = true;
2897 }
2898 else if (thisobj->objectSubId == 0)
2899 {
2900
2901
2902
2903
2904
2905
2906 result = true;
2907 }
2909 {
2910
2911
2912
2913
2914
2917 }
2918 }
2919 }
2920
2921 return result;
2922}
2923
2924
2925
2926
2927
2928void
2932{
2936 behavior);
2937}
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947void
2955
2956
2957
2958
2959void
2967
2968
2969
2970
2971static void
2973{
2976 int nkeys;
2979
2981
2991 {
2996 nkeys = 3;
2997 }
2998 else
2999 nkeys = 2;
3000
3002 NULL, nkeys, key);
3003
3006
3008
3010}
#define InvalidAttrNumber
#define ngettext(s, p, n)
#define Assert(condition)
#define OidIsValid(objectId)
bool IsPinnedObject(Oid classId, Oid objectId)
bool IsSharedRelation(Oid relationId)
void DeleteSequenceTuple(Oid relid)
static bool object_address_present_add_flags(const ObjectAddress *object, int flags, ObjectAddresses *addrs)
#define DEPFLAG_PARTITION
void performMultipleDeletions(const ObjectAddresses *objects, DropBehavior behavior, int flags)
static void add_exact_object_address_extra(const ObjectAddress *object, const ObjectAddressExtra *extra, ObjectAddresses *addrs)
void record_object_address_dependencies(const ObjectAddress *depender, ObjectAddresses *referenced, DependencyType behavior)
static void DropObjectById(const ObjectAddress *object)
static int object_address_comparator(const void *a, const void *b)
void sort_object_addresses(ObjectAddresses *addrs)
static void doDeletion(const ObjectAddress *object, int flags)
static bool stack_address_present_add_flags(const ObjectAddress *object, int flags, ObjectAddressStack *stack)
void performDeletionCheck(const ObjectAddress *object, DropBehavior behavior, int flags)
static void add_object_address(Oid classId, Oid objectId, int32 subId, ObjectAddresses *addrs)
static bool find_expr_references_walker(Node *node, find_expr_references_context *context)
static void eliminate_duplicate_dependencies(ObjectAddresses *addrs)
void AcquireDeletionLock(const ObjectAddress *object, int flags)
void performDeletion(const ObjectAddress *object, DropBehavior behavior, int flags)
bool query_uses_temp_object(Query *query, ObjectAddress *temp_object)
static void deleteOneObject(const ObjectAddress *object, Relation *depRel, int32 flags)
static void DeleteInitPrivs(const ObjectAddress *object)
#define MAX_REPORTED_DEPS
static void process_function_rte_ref(RangeTblEntry *rte, AttrNumber attnum, find_expr_references_context *context)
static void reportDependentObjects(const ObjectAddresses *targetObjects, DropBehavior behavior, int flags, const ObjectAddress *origObject)
void ReleaseDeletionLock(const ObjectAddress *object)
void recordDependencyOnSingleRelExpr(const ObjectAddress *depender, Node *expr, Oid relId, DependencyType behavior, DependencyType self_behavior, bool reverse_self)
void recordDependencyOnExpr(const ObjectAddress *depender, Node *expr, List *rtable, DependencyType behavior)
static void findDependentObjects(const ObjectAddress *object, int objflags, int flags, ObjectAddressStack *stack, ObjectAddresses *targetObjects, const ObjectAddresses *pendingObjects, Relation *depRel)
void collectDependenciesOfExpr(ObjectAddresses *addrs, Node *expr, List *rtable)
bool object_address_present(const ObjectAddress *object, const ObjectAddresses *addrs)
bool find_temp_object(const ObjectAddresses *addrs, bool local_temp_okay, ObjectAddress *foundobj)
void add_exact_object_address(const ObjectAddress *object, ObjectAddresses *addrs)
ObjectAddresses * new_object_addresses(void)
#define DEPFLAG_SUBOBJECT
#define DEPFLAG_EXTENSION
static void deleteObjectsInList(ObjectAddresses *targetObjects, Relation *depRel, int flags)
void free_object_addresses(ObjectAddresses *addrs)
#define PERFORM_DELETION_CONCURRENTLY
#define PERFORM_DELETION_SKIP_EXTENSIONS
@ DEPENDENCY_AUTO_EXTENSION
@ DEPENDENCY_PARTITION_PRI
@ DEPENDENCY_PARTITION_SEC
#define PERFORM_DELETION_CONCURRENT_LOCK
#define PERFORM_DELETION_QUIETLY
#define PERFORM_DELETION_SKIP_ORIGINAL
#define PERFORM_DELETION_INTERNAL
bool message_level_is_interesting(int elevel)
int errcode(int sqlerrcode)
int int errdetail_internal(const char *fmt,...) pg_attribute_printf(1
int errhint(const char *fmt,...) pg_attribute_printf(1
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
int int int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
int int int errdetail_log(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
void EventTriggerSQLDropAddObject(const ObjectAddress *object, bool original, bool normal)
bool trackDroppedObjectsNeeded(void)
bool EventTriggerSupportsObject(const ObjectAddress *object)
Oid CurrentExtensionObject
void RemoveExtensionById(Oid extId)
#define palloc_object(type)
#define palloc_array(type, count)
TupleDesc get_expr_result_tupdesc(Node *expr, bool noError)
void RemoveFunctionById(Oid funcOid)
void systable_endscan(SysScanDesc sysscan)
bool systable_recheck_tuple(SysScanDesc sysscan, HeapTuple tup)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
void RemoveAttributeById(Oid relid, AttrNumber attnum)
void heap_drop_with_catalog(Oid relid)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
void index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode)
void CatalogTupleDelete(Relation heapRel, const ItemPointerData *tid)
List * list_delete_first(List *list)
List * lcons(void *datum, List *list)
void LockSharedObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void UnlockRelationOid(Oid relid, LOCKMODE lockmode)
void LockDatabaseObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
void LockRelationOid(Oid relid, LOCKMODE lockmode)
void UnlockDatabaseObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
#define AccessExclusiveLock
#define ShareUpdateExclusiveLock
char get_rel_relkind(Oid relid)
Oid get_typ_typrelid(Oid typid)
Oid getBaseType(Oid typid)
void * repalloc(void *pointer, Size size)
void pfree(void *pointer)
bool isTempNamespace(Oid namespaceId)
bool isAnyTempNamespace(Oid namespaceId)
Oid exprType(const Node *expr)
#define query_tree_walker(q, w, c, f)
#define QTW_EXAMINE_SORTGROUP
#define expression_tree_walker(n, w, c)
#define QTW_IGNORE_JOINALIASES
#define IsA(nodeptr, _type_)
#define InvokeObjectDropHookArg(classId, objectId, subId, dropflags)
AttrNumber get_object_attnum_oid(Oid class_id)
const char * get_object_class_descr(Oid class_id)
char * getObjectDescription(const ObjectAddress *object, bool missing_ok)
Oid get_object_oid_index(Oid class_id)
SysCacheIdentifier get_object_catcache_oid(Oid class_id)
Oid get_object_namespace(const ObjectAddress *address)
void RemoveOperatorById(Oid operOid)
#define rt_fetch(rangetable_index, rangetable)
void RemoveAttrDefaultById(Oid attrdefId)
void RemoveConstraintById(Oid conId)
void recordMultipleDependencies(const ObjectAddress *depender, const ObjectAddress *referenced, int nreferenced, DependencyType behavior)
void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior)
END_CATALOG_STRUCT typedef FormData_pg_depend * Form_pg_depend
void LargeObjectDrop(Oid loid)
static int list_length(const List *l)
static void * list_nth(const List *list, int n)
void deleteSharedDependencyRecordsFor(Oid classId, Oid objectId, int32 objectSubId)
void RemovePolicyById(Oid policy_id)
#define qsort(a, b, c, d)
static Oid DatumGetObjectId(Datum X)
static Datum ObjectIdGetDatum(Oid X)
static Datum Int32GetDatum(int32 X)
void RemovePublicationSchemaById(Oid psoid)
void RemovePublicationById(Oid pubid)
void RemovePublicationRelById(Oid proid)
void RemoveRewriteRuleById(Oid ruleOid)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
void DeleteSecurityLabel(const ObjectAddress *object)
void check_stack_depth(void)
void RemoveStatisticsById(Oid statsOid)
#define BTEqualStrategyNumber
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
const ObjectAddress * object
struct ObjectAddressStack * next
ObjectAddressExtra * extras
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
#define SearchSysCacheExists1(cacheId, key1)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
void RemoveTriggerById(Oid trigOid)
void RemoveTSConfigurationById(Oid cfgId)
void RemoveTypeById(Oid typeOid)
void CommandCounterIncrement(void)