PostgreSQL Source Code: src/backend/executor/execTuples.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
59
72
74 bool skipjunk);
76 int natts);
80 bool transfer_pin);
82
83
88
89
90
91
92
93
94
95
96
97static void
99{
100}
101
102static void
104{
105}
106
107static void
109{
111 {
113
115 vslot->data = NULL;
116
117 slot->tts_flags &= ~TTS_FLAG_SHOULDFREE;
118 }
119
123}
124
125
126
127
128
129static void
131{
132 elog(ERROR, "getsomeattrs is not required to be called on a virtual tuple table slot");
133}
134
135
136
137
138
139
142{
144
146 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
147 errmsg("cannot retrieve a system column in this context")));
148
149 return 0;
150}
151
152
153
154
155
156static bool
158{
160
162 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
163 errmsg("don't have transaction information for this type of tuple")));
164
165 return false;
166}
167
168
169
170
171
172
173
174
175static void
177{
182
183
185 return;
186
187
188 for (int natt = 0; natt < desc->natts; natt++)
189 {
192
194 continue;
195
197
198 if (att->attlen == -1 &&
200 {
201
202
203
204
207 }
208 else
209 {
212 }
213 }
214
215
216 if (sz == 0)
217 return;
218
219
222
223
224 for (int natt = 0; natt < desc->natts; natt++)
225 {
228
230 continue;
231
233
234 if (att->attlen == -1 &&
236 {
237 Size data_length;
238
239
240
241
242
244
249
251 data += data_length;
252 }
253 else
254 {
255 Size data_length = 0;
256
259
261
263 data += data_length;
264 }
265 }
266}
267
268static void
270{
272
274
276
277 for (int natt = 0; natt < srcdesc->natts; natt++)
278 {
281 }
282
284 dstslot->tts_flags &= ~TTS_FLAG_EMPTY;
285
286
288}
289
292{
294
298}
299
302{
304
308 extra);
309}
310
311
312
313
314
315
316static void
318{
319}
320
321static void
323{
324}
325
326static void
328{
330
331
333 {
335 slot->tts_flags &= ~TTS_FLAG_SHOULDFREE;
336 }
337
341 hslot->off = 0;
342 hslot->tuple = NULL;
343}
344
345static void
347{
349
351
353}
354
357{
359
361
362
363
364
365
366 if (!hslot->tuple)
368 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
369 errmsg("cannot retrieve a system column in this context")));
370
373}
374
375static bool
377{
380
382
383
384
385
386
387
388 if (!hslot->tuple)
390 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
391 errmsg("don't have a storage tuple in this context")));
392
394
396}
397
398static void
400{
403
405
406
408 return;
409
411
412
413
414
415
417 hslot->off = 0;
418
419 if (!hslot->tuple)
423 else
424 {
425
426
427
428
429
431 }
432
434
436}
437
438static void
440{
443
447
449}
450
453{
455
457 if (!hslot->tuple)
459
460 return hslot->tuple;
461}
462
465{
467
469 if (!hslot->tuple)
471
473}
474
477{
479
480 if (!hslot->tuple)
482
484}
485
486static void
488{
490
492
494 hslot->tuple = tuple;
495 hslot->off = 0;
498
499 if (shouldFree)
501}
502
503
504
505
506
507
508static void
510{
512
513
514
515
516
518}
519
520static void
522{
523}
524
525static void
527{
529
531 {
533 slot->tts_flags &= ~TTS_FLAG_SHOULDFREE;
534 }
535
539 mslot->off = 0;
541}
542
543static void
545{
547
549
551}
552
553
554
555
556
559{
561
563 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
564 errmsg("cannot retrieve a system column in this context")));
565
566 return 0;
567}
568
569
570
571
572
573
574static bool
576{
578
580 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
581 errmsg("don't have transaction information for this type of tuple")));
582
583 return false;
584}
585
586static void
588{
591
593
594
596 return;
597
599
600
601
602
603
605 mslot->off = 0;
606
608 {
612 0);
613 }
614 else
615 {
616
617
618
619
620
621
623 }
624
626
628
631
633}
634
635static void
637{
640
644
646}
647
650{
652
655
657}
658
661{
663
666
668}
669
672{
674
677
679}
680
681static void
683{
685
687
690
691 slot->tts_flags &= ~TTS_FLAG_EMPTY;
693 mslot->off = 0;
694
699
700
701 if (shouldFree)
703}
704
705
706
707
708
709
710static void
712{
713}
714
715static void
717{
718}
719
720static void
722{
724
725
726
727
728
729
731 {
732
734
736 slot->tts_flags &= ~TTS_FLAG_SHOULDFREE;
737 }
738
741
745 bslot->base.tuple = NULL;
746 bslot->base.off = 0;
748}
749
750static void
752{
754
756
758}
759
762{
764
766
767
768
769
770
771 if (!bslot->base.tuple)
773 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
774 errmsg("cannot retrieve a system column in this context")));
775
778}
779
780static bool
782{
785
787
788
789
790
791
792
793 if (!bslot->base.tuple)
795 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
796 errmsg("don't have a storage tuple in this context")));
797
799
801}
802
803static void
805{
808
810
811
813 return;
814
816
817
818
819
820
821 bslot->base.off = 0;
823
824 if (!bslot->base.tuple)
825 {
826
827
828
829
830
831
832
836 }
837 else
838 {
839 bslot->base.tuple = heap_copytuple(bslot->base.tuple);
840
841
842
843
844
848 }
849
850
851
852
853
854
855
856
858
860}
861
862static void
864{
867
868
869
870
871
872
875 !bsrcslot->base.tuple)
876 {
878
880 dstslot->tts_flags &= ~TTS_FLAG_EMPTY;
885 }
886 else
887 {
889
891 bsrcslot->buffer, false);
892
893
894
895
896
897
898
899 memcpy(&bdstslot->base.tupdata, bdstslot->base.tuple, sizeof(HeapTupleData));
900 bdstslot->base.tuple = &bdstslot->base.tupdata;
901 }
902}
903
906{
908
910
911 if (!bslot->base.tuple)
913
914 return bslot->base.tuple;
915}
916
919{
921
923
924 if (!bslot->base.tuple)
926
928}
929
932{
934
936
937 if (!bslot->base.tuple)
939
941}
942
943static inline void
945 Buffer buffer, bool transfer_pin)
946{
948
950 {
951
953
955 slot->tts_flags &= ~TTS_FLAG_SHOULDFREE;
956 }
957
958 slot->tts_flags &= ~TTS_FLAG_EMPTY;
960 bslot->base.tuple = tuple;
961 bslot->base.off = 0;
963
964
965
966
967
968
969
970
971
972
973
974
975 if (bslot->buffer != buffer)
976 {
979
980 bslot->buffer = buffer;
981
984 }
986 {
987
988
989
990
992 }
993}
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1020 int attnum, int natts, bool slow,
1021 bool hasnulls, uint32 *offp, bool *slowp)
1022{
1027 char *tp;
1029 bool slownext = false;
1030
1031 tp = (char *) tup + tup->t_hoff;
1032
1034 {
1036
1038 {
1040 isnull[attnum] = true;
1041 if (!slow)
1042 {
1043 *slowp = true;
1045 }
1046 else
1047 continue;
1048 }
1049
1050 isnull[attnum] = false;
1051
1052
1055 else if (thisatt->attlen == -1)
1056 {
1057
1058
1059
1060
1061
1062
1065 else
1066 {
1069 -1,
1070 tp + *offp);
1071
1072 if (!slow)
1073 slownext = true;
1074 }
1075 }
1076 else
1077 {
1078
1080
1081 if (!slow)
1082 thisatt->attcacheoff = *offp;
1083 }
1084
1086
1088
1089
1090 if (!slow)
1091 {
1092
1093
1094
1095
1096 if (slownext || thisatt->attlen <= 0)
1097 {
1098 *slowp = true;
1100 }
1101 }
1102 }
1103
1104 return natts;
1105}
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1123 int natts)
1124{
1127 uint32 off;
1128 bool slow;
1129
1130
1132
1133
1134
1135
1136
1139 {
1140
1141 off = 0;
1142 slow = false;
1143 }
1144 else
1145 {
1146
1147 off = *offp;
1149 }
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162 if (!slow)
1163 {
1164
1165 if (!hasnulls)
1167 tuple,
1169 natts,
1170 false,
1171 false,
1172 &off,
1173 &slow);
1174 else
1176 tuple,
1178 natts,
1179 false,
1180 true,
1181 &off,
1182 &slow);
1183 }
1184
1185
1187 {
1188
1190 tuple,
1192 natts,
1193 true,
1194 hasnulls,
1195 &off,
1196 &slow);
1197 }
1198
1199
1200
1201
1203 *offp = off;
1204 if (slow)
1206 else
1207 slot->tts_flags &= ~TTS_FLAG_SLOW;
1208}
1209
1220
1221
1222
1223
1224
1225 .get_heap_tuple = NULL,
1226 .get_minimal_tuple = NULL,
1229};
1230
1242
1243
1244 .get_minimal_tuple = NULL,
1247};
1248
1259
1260
1261 .get_heap_tuple = NULL,
1265};
1266
1278
1279
1280 .get_minimal_tuple = NULL,
1283};
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1303{
1304 Size basesz,
1305 allocsz;
1307
1309
1310
1311
1312
1313
1314 if (tupleDesc)
1315 allocsz = MAXALIGN(basesz) +
1318 else
1319 allocsz = basesz;
1320
1321 slot = palloc0(allocsz);
1322
1324 slot->type = T_TupleTableSlot;
1326 if (tupleDesc != NULL)
1331
1332 if (tupleDesc != NULL)
1333 {
1335 (((char *) slot)
1338 (((char *) slot)
1341
1343 }
1344
1345
1346
1347
1349
1350 return slot;
1351}
1352
1353
1354
1355
1356
1357
1358
1362{
1364
1365 *tupleTable = lappend(*tupleTable, slot);
1366
1367 return slot;
1368}
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379void
1381 bool shouldFree)
1382{
1384
1385 foreach(lc, tupleTable)
1386 {
1388
1389
1393 {
1396 }
1397
1398
1399 if (shouldFree)
1400 {
1402 {
1407 }
1409 }
1410 }
1411
1412
1413 if (shouldFree)
1415}
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1429{
1431
1432 return slot;
1433}
1434
1435
1436
1437
1438
1439
1440
1441
1442void
1444{
1445
1452 {
1457 }
1459}
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477void
1479 TupleDesc tupdesc)
1480{
1482
1483
1485
1486
1487
1488
1489
1492
1497
1498
1499
1500
1503
1504
1505
1506
1507
1512}
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1543 bool shouldFree)
1544{
1545
1546
1547
1548 Assert(tuple != NULL);
1549 Assert(slot != NULL);
1551
1553 elog(ERROR, "trying to store a heap tuple into wrong type of slot");
1555
1557
1558 return slot;
1559}
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1584{
1585
1586
1587
1588 Assert(tuple != NULL);
1589 Assert(slot != NULL);
1592
1594 elog(ERROR, "trying to store an on-disk heap tuple into wrong type of slot");
1596
1598
1599 return slot;
1600}
1601
1602
1603
1604
1605
1610{
1611
1612
1613
1614 Assert(tuple != NULL);
1615 Assert(slot != NULL);
1618
1620 elog(ERROR, "trying to store an on-disk heap tuple into wrong type of slot");
1622
1624
1625 return slot;
1626}
1627
1628
1629
1630
1631
1632
1633
1637 bool shouldFree)
1638{
1639
1640
1641
1642 Assert(mtup != NULL);
1643 Assert(slot != NULL);
1645
1647 elog(ERROR, "trying to store a minimal tuple into wrong type of slot");
1649
1650 return slot;
1651}
1652
1653
1654
1655
1656
1657void
1660 bool shouldFree)
1661{
1663 {
1665 }
1667 {
1670
1672 slot->tts_flags &= ~TTS_FLAG_EMPTY;
1677
1678 if (shouldFree)
1680 }
1681 else
1682 {
1687
1688 if (shouldFree)
1689 {
1692 }
1693 }
1694}
1695
1696
1697
1698
1699
1700void
1703 bool shouldFree)
1704{
1706 {
1708 }
1709 else
1710 {
1712
1714
1720
1721 if (shouldFree)
1722 {
1725 }
1726 }
1727}
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1742{
1743
1744
1745
1746 Assert(slot != NULL);
1749
1750 slot->tts_flags &= ~TTS_FLAG_EMPTY;
1752
1753 return slot;
1754}
1755
1756
1757
1758
1759
1760
1761
1762
1763
1766{
1767
1768
1769
1770 Assert(slot != NULL);
1772
1773
1775
1776
1777
1778
1783
1785}
1786
1787
1788
1789
1790
1791
1792
1793
1794void
1796{
1799
1801
1805
1807
1811}
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1834{
1835
1836
1837
1838 Assert(slot != NULL);
1840
1841
1842 if (materialize)
1844
1846 {
1847 if (shouldFree)
1848 *shouldFree = true;
1850 }
1851 else
1852 {
1853 if (shouldFree)
1854 *shouldFree = false;
1856 }
1857}
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1882 bool *shouldFree)
1883{
1884
1885
1886
1887 Assert(slot != NULL);
1889
1891 {
1892 if (shouldFree)
1893 *shouldFree = false;
1895 }
1896 else
1897 {
1898 if (shouldFree)
1899 *shouldFree = true;
1901 }
1902}
1903
1904
1905
1906
1907
1908
1909
1910
1913{
1916 bool shouldFree;
1918
1919
1922
1923
1925
1926 if (shouldFree)
1928
1929 return ret;
1930}
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943void
1945{
1947
1949}
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967void
1969{
1971
1975
1979}
1980
1981
1982
1983
1984
1985
1986
1987void
1990{
1993}
1994
1995
1996
1997
1998
1999void
2002{
2004 tupledesc, tts_ops);
2007 scanstate->ps.scanops = tts_ops;
2009}
2010
2011
2012
2013
2014
2015
2016
2017
2018
2023{
2025}
2026
2027
2028
2029
2030
2031
2032
2033
2034
2038{
2040
2042}
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056void
2058{
2060
2063
2064 if (!attrmiss)
2065 {
2066
2067 memset(slot->tts_values + startAttNum, 0,
2068 (lastAttNum - startAttNum) * sizeof(Datum));
2069 memset(slot->tts_isnull + startAttNum, 1,
2070 (lastAttNum - startAttNum) * sizeof(bool));
2071 }
2072 else
2073 {
2074 int missattnum;
2075
2076
2077 for (missattnum = startAttNum;
2078 missattnum < lastAttNum;
2079 missattnum++)
2080 {
2083 }
2084 }
2085}
2086
2087
2088
2089
2090void
2092{
2093
2096
2099
2100
2102
2103
2104
2105
2106
2108 {
2111 }
2112}
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2128{
2130}
2131
2132
2133
2134
2135
2136
2137
2140{
2142}
2143
2146{
2149 int len;
2150 int cur_resno = 1;
2151
2152 if (skipjunk)
2154 else
2157
2158 foreach(l, targetList)
2159 {
2161
2162 if (skipjunk && tle->resjunk)
2163 continue;
2165 cur_resno,
2166 tle->resname,
2169 0);
2171 cur_resno,
2173 cur_resno++;
2174 }
2175
2176 return typeInfo;
2177}
2178
2179
2180
2181
2182
2183
2184
2187{
2190 int cur_resno = 1;
2191
2193
2194 foreach(lc, exprList)
2195 {
2197
2199 cur_resno,
2200 NULL,
2203 0);
2205 cur_resno,
2207 cur_resno++;
2208 }
2209
2210 return typeInfo;
2211}
2212
2213
2214
2215
2216
2217
2218void
2220{
2221 int colno = 0;
2223
2224
2227
2228 foreach(lc, namesList)
2229 {
2232
2233
2234 if (colno >= typeInfo->natts)
2235 break;
2237 colno++;
2238
2239
2240
2241
2242
2243 if (cname[0] == '\0' || attr->attisdropped)
2244 continue;
2245
2246
2248 }
2249}
2250
2251
2252
2253
2254
2255
2256
2257
2258
2261{
2262 if (tupdesc->tdtypeid == RECORDOID &&
2265
2266 return tupdesc;
2267}
2268
2269
2270
2271
2272
2273
2276{
2277 int natts = tupdesc->natts;
2278 int i;
2279 Oid atttypeid;
2280 Oid attinfuncid;
2282 Oid *attioparams;
2283 int32 *atttypmods;
2285
2287
2288
2290
2291
2292
2293
2295 attioparams = (Oid *) palloc0(natts * sizeof(Oid));
2297
2298 for (i = 0; i < natts; i++)
2299 {
2301
2302
2303 if (!att->attisdropped)
2304 {
2305 atttypeid = att->atttypid;
2307 fmgr_info(attinfuncid, &attinfuncinfo[i]);
2308 atttypmods[i] = att->atttypmod;
2309 }
2310 }
2311 attinmeta->attinfuncs = attinfuncinfo;
2314
2315 return attinmeta;
2316}
2317
2318
2319
2320
2321
2322
2325{
2327 int natts = tupdesc->natts;
2329 bool *nulls;
2330 int i;
2332
2334 nulls = (bool *) palloc(natts * sizeof(bool));
2335
2336
2337
2338
2339
2340 for (i = 0; i < natts; i++)
2341 {
2343 {
2344
2350 nulls[i] = false;
2351 else
2352 nulls[i] = true;
2353 }
2354 else
2355 {
2356
2358 nulls[i] = true;
2359 }
2360 }
2361
2362
2363
2364
2366
2367
2368
2369
2370
2373
2374 return tuple;
2375}
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2414{
2417
2418
2421
2422
2425
2426
2429 tupDesc);
2430
2432
2433 return result;
2434}
2435
2436
2437
2438
2439
2440
2441
2442
2447{
2449
2451
2454
2456
2457 return tstate;
2458}
2459
2460
2461
2462
2463void
2465{
2468
2469
2471
2472
2474 memcpy(slot->tts_isnull, isnull, natts * sizeof(bool));
2475
2476
2478
2479
2481
2482
2484}
2485
2486
2487
2488
2489
2490
2491void
2493{
2495 bool isnull[1] = {false};
2496
2497 while (*txt)
2498 {
2499 const char *eol;
2500 int len;
2501
2502 eol = strchr(txt, '\n');
2503 if (eol)
2504 {
2505 len = eol - txt;
2506 eol++;
2507 }
2508 else
2509 {
2510 len = strlen(txt);
2511 eol = txt + len;
2512 }
2513
2517 txt = eol;
2518 }
2519}
2520
2521void
2523{
2525
2528}
static Datum values[MAXATTR]
void IncrBufferRefCount(Buffer buffer)
void ReleaseBuffer(Buffer buffer)
static bool BufferIsValid(Buffer bufnum)
#define pg_attribute_always_inline
#define MemSet(start, val, len)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
static void tts_heap_store_tuple(TupleTableSlot *slot, HeapTuple tuple, bool shouldFree)
static void tts_buffer_heap_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
static void tts_buffer_heap_store_tuple(TupleTableSlot *slot, HeapTuple tuple, Buffer buffer, bool transfer_pin)
static HeapTuple tts_minimal_copy_heap_tuple(TupleTableSlot *slot)
static MinimalTuple tts_virtual_copy_minimal_tuple(TupleTableSlot *slot, Size extra)
void ExecResetTupleTable(List *tupleTable, bool shouldFree)
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
static Datum tts_heap_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
static HeapTuple tts_buffer_heap_copy_heap_tuple(TupleTableSlot *slot)
HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values)
static void tts_buffer_heap_clear(TupleTableSlot *slot)
TupleTableSlot * ExecStorePinnedBufferHeapTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer)
static void tts_minimal_store_tuple(TupleTableSlot *slot, MinimalTuple mtup, bool shouldFree)
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
void do_tup_output(TupOutputState *tstate, const Datum *values, const bool *isnull)
const TupleTableSlotOps TTSOpsVirtual
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
static Datum tts_buffer_heap_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
static void tts_minimal_init(TupleTableSlot *slot)
static void tts_heap_init(TupleTableSlot *slot)
TupleTableSlot * ExecStoreVirtualTuple(TupleTableSlot *slot)
static bool tts_buffer_is_current_xact_tuple(TupleTableSlot *slot)
Datum HeapTupleHeaderGetDatum(HeapTupleHeader tuple)
TupleTableSlot * ExecAllocTableSlot(List **tupleTable, TupleDesc desc, const TupleTableSlotOps *tts_ops)
static TupleDesc ExecTypeFromTLInternal(List *targetList, bool skipjunk)
static pg_attribute_always_inline int slot_deform_heap_tuple_internal(TupleTableSlot *slot, HeapTuple tuple, int attnum, int natts, bool slow, bool hasnulls, uint32 *offp, bool *slowp)
static HeapTuple tts_buffer_heap_get_heap_tuple(TupleTableSlot *slot)
TupleDesc ExecCleanTypeFromTL(List *targetList)
static HeapTuple tts_virtual_copy_heap_tuple(TupleTableSlot *slot)
void ExecInitResultSlot(PlanState *planstate, const TupleTableSlotOps *tts_ops)
void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList)
void ExecForceStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
const TupleTableSlotOps TTSOpsBufferHeapTuple
static void tts_buffer_heap_release(TupleTableSlot *slot)
void end_tup_output(TupOutputState *tstate)
static void tts_minimal_clear(TupleTableSlot *slot)
static MinimalTuple tts_buffer_heap_copy_minimal_tuple(TupleTableSlot *slot, Size extra)
MinimalTuple ExecFetchSlotMinimalTuple(TupleTableSlot *slot, bool *shouldFree)
void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
void ExecInitResultTypeTL(PlanState *planstate)
TupleTableSlot * ExecStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
static void tts_virtual_clear(TupleTableSlot *slot)
static void tts_buffer_heap_materialize(TupleTableSlot *slot)
void do_text_output_multiline(TupOutputState *tstate, const char *txt)
static void tts_virtual_release(TupleTableSlot *slot)
HeapTuple ExecFetchSlotHeapTuple(TupleTableSlot *slot, bool materialize, bool *shouldFree)
void slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, int lastAttNum)
static void tts_minimal_materialize(TupleTableSlot *slot)
TupleTableSlot * ExecStoreBufferHeapTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer)
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
static MinimalTuple tts_minimal_get_minimal_tuple(TupleTableSlot *slot)
static void tts_minimal_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
static void tts_virtual_init(TupleTableSlot *slot)
void ExecStoreHeapTupleDatum(Datum data, TupleTableSlot *slot)
void ExecSetSlotDescriptor(TupleTableSlot *slot, TupleDesc tupdesc)
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
static void tts_minimal_release(TupleTableSlot *slot)
Datum ExecFetchSlotHeapTupleDatum(TupleTableSlot *slot)
const TupleTableSlotOps TTSOpsHeapTuple
static HeapTuple tts_heap_copy_heap_tuple(TupleTableSlot *slot)
void slot_getsomeattrs_int(TupleTableSlot *slot, int attnum)
static Datum tts_minimal_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
const TupleTableSlotOps TTSOpsMinimalTuple
static pg_attribute_always_inline void slot_deform_heap_tuple(TupleTableSlot *slot, HeapTuple tuple, uint32 *offp, int natts)
static void tts_virtual_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
TupOutputState * begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
static bool tts_virtual_is_current_xact_tuple(TupleTableSlot *slot)
static void tts_buffer_heap_getsomeattrs(TupleTableSlot *slot, int natts)
static void tts_virtual_getsomeattrs(TupleTableSlot *slot, int natts)
static MinimalTuple tts_heap_copy_minimal_tuple(TupleTableSlot *slot, Size extra)
TupleDesc ExecTypeFromExprList(List *exprList)
static void tts_heap_materialize(TupleTableSlot *slot)
TupleTableSlot * ExecStoreAllNullTuple(TupleTableSlot *slot)
static void tts_virtual_materialize(TupleTableSlot *slot)
TupleDesc ExecTypeFromTL(List *targetList)
AttInMetadata * TupleDescGetAttInMetadata(TupleDesc tupdesc)
static bool tts_minimal_is_current_xact_tuple(TupleTableSlot *slot)
static MinimalTuple tts_minimal_copy_minimal_tuple(TupleTableSlot *slot, Size extra)
static HeapTuple tts_heap_get_heap_tuple(TupleTableSlot *slot)
static void tts_minimal_getsomeattrs(TupleTableSlot *slot, int natts)
TupleTableSlot * MakeTupleTableSlot(TupleDesc tupleDesc, const TupleTableSlotOps *tts_ops)
static void tts_heap_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
TupleTableSlot * ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops)
static void tts_heap_clear(TupleTableSlot *slot)
TupleTableSlot * ExecStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
static void tts_heap_getsomeattrs(TupleTableSlot *slot, int natts)
static void tts_heap_release(TupleTableSlot *slot)
static void tts_buffer_heap_init(TupleTableSlot *slot)
static bool tts_heap_is_current_xact_tuple(TupleTableSlot *slot)
void ExecForceStoreHeapTuple(HeapTuple tuple, TupleTableSlot *slot, bool shouldFree)
static Datum tts_virtual_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
int ExecTargetListLength(List *targetlist)
int ExecCleanTargetListLength(List *targetlist)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void EOH_flatten_into(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
Size EOH_get_flat_size(ExpandedObjectHeader *eohptr)
Datum InputFunctionCall(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
#define DatumGetHeapTupleHeader(X)
Assert(PointerIsAligned(start, uint64))
Datum toast_flatten_tuple_to_datum(HeapTupleHeader tup, uint32 tup_len, TupleDesc tupleDesc)
HeapTuple heap_copytuple(HeapTuple tuple)
MinimalTuple heap_copy_minimal_tuple(MinimalTuple mtup, Size extra)
Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
MinimalTuple heap_form_minimal_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull, Size extra)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
void heap_free_minimal_tuple(MinimalTuple mtup)
MinimalTuple minimal_tuple_from_heap_tuple(HeapTuple htup, Size extra)
void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull)
Datum heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc)
HeapTuple heap_tuple_from_minimal_tuple(MinimalTuple mtup)
void heap_freetuple(HeapTuple htup)
HeapTupleHeaderData * HeapTupleHeader
#define MINIMAL_TUPLE_OFFSET
#define HeapTupleHeaderGetNatts(tup)
static bool HeapTupleHasNulls(const HeapTupleData *tuple)
static int32 HeapTupleHeaderGetTypMod(const HeapTupleHeaderData *tup)
static TransactionId HeapTupleHeaderGetRawXmin(const HeapTupleHeaderData *tup)
static uint32 HeapTupleHeaderGetDatumLength(const HeapTupleHeaderData *tup)
#define HeapTupleHeaderHasExternal(tup)
static Oid HeapTupleHeaderGetTypeId(const HeapTupleHeaderData *tup)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
List * lappend(List *list, void *datum)
void list_free(List *list)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
void * MemoryContextAlloc(MemoryContext context, Size size)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
void namestrcpy(Name name, const char *str)
Oid exprType(const Node *expr)
int32 exprTypmod(const Node *expr)
Oid exprCollation(const Node *expr)
#define IsA(nodeptr, _type_)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
FormData_pg_attribute * Form_pg_attribute
#define lfirst_node(type, lc)
static int list_length(const List *l)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
const TupleTableSlotOps * resultops
const TupleTableSlotOps * scanops
TupleDesc ps_ResultTupleDesc
TupleTableSlot * ps_ResultTupleSlot
TupleTableSlot * ss_ScanTupleSlot
struct AttrMissing * missing
HeapTuple(* get_heap_tuple)(TupleTableSlot *slot)
MinimalTuple(* copy_minimal_tuple)(TupleTableSlot *slot, Size extra)
void(* init)(TupleTableSlot *slot)
void(* getsomeattrs)(TupleTableSlot *slot, int natts)
HeapTuple(* copy_heap_tuple)(TupleTableSlot *slot)
MinimalTuple(* get_minimal_tuple)(TupleTableSlot *slot)
void(* materialize)(TupleTableSlot *slot)
void(* release)(TupleTableSlot *slot)
TupleDesc tts_tupleDescriptor
const TupleTableSlotOps *const tts_ops
void(* rStartup)(DestReceiver *self, int operation, TupleDesc typeinfo)
void(* rShutdown)(DestReceiver *self)
bool(* receiveSlot)(TupleTableSlot *slot, DestReceiver *self)
TupleDesc CreateTemplateTupleDesc(int natts)
void TupleDescInitEntryCollation(TupleDesc desc, AttrNumber attributeNumber, Oid collationid)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
#define ReleaseTupleDesc(tupdesc)
#define PinTupleDesc(tupdesc)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
static CompactAttribute * TupleDescCompactAttr(TupleDesc tupdesc, int i)
#define att_nominal_alignby(cur_offset, attalignby)
static bool att_isnull(int ATT, const bits8 *BITS)
#define att_addlength_pointer(cur_offset, attlen, attptr)
#define att_pointer_alignby(cur_offset, attalignby, attlen, attptr)
#define att_addlength_datum(cur_offset, attlen, attdatum)
#define TTS_FLAG_SHOULDFREE
#define TTS_IS_MINIMALTUPLE(slot)
static MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot *slot)
struct MinimalTupleTableSlot MinimalTupleTableSlot
static HeapTuple ExecCopySlotHeapTuple(TupleTableSlot *slot)
#define TTS_IS_BUFFERTUPLE(slot)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
static void slot_getallattrs(TupleTableSlot *slot)
struct HeapTupleTableSlot HeapTupleTableSlot
#define TTS_SHOULDFREE(slot)
struct BufferHeapTupleTableSlot BufferHeapTupleTableSlot
static void ExecMaterializeSlot(TupleTableSlot *slot)
struct VirtualTupleTableSlot VirtualTupleTableSlot
#define TTS_IS_HEAPTUPLE(slot)
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
void assign_record_type_typmod(TupleDesc tupDesc)
#define VARATT_IS_EXTERNAL_EXPANDED(PTR)
text * cstring_to_text_with_len(const char *s, int len)
bool TransactionIdIsCurrentTransactionId(TransactionId xid)