Skip to content

Commit 448fee2

Browse files
committed
Make comments reflect that omission of SPI_gettypmod() is intentional.
1 parent e852c5d commit 448fee2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/backend/executor/spi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,12 @@ SPI_gettype(TupleDesc tupdesc, int fnumber)
940940
return result;
941941
}
942942

943+
/*
944+
* Get the data type OID for a column.
945+
*
946+
* There's nothing similar for typmod and typcollation. The rare consumers
947+
* thereof should inspect the TupleDesc directly.
948+
*/
943949
Oid
944950
SPI_gettypeid(TupleDesc tupdesc, int fnumber)
945951
{

src/pl/plpgsql/src/pl_exec.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4446,7 +4446,6 @@ exec_eval_datum(PLpgSQL_execstate *estate,
44464446
errmsg("record \"%s\" has no field \"%s\"",
44474447
rec->refname, recfield->fieldname)));
44484448
*typeid = SPI_gettypeid(rec->tupdesc, fno);
4449-
/* XXX there's no SPI_gettypmod, for some reason */
44504449
if (fno > 0)
44514450
*typetypmod = rec->tupdesc->attrs[fno - 1]->atttypmod;
44524451
else
@@ -4623,12 +4622,10 @@ exec_get_datum_type_info(PLpgSQL_execstate *estate,
46234622
errmsg("record \"%s\" has no field \"%s\"",
46244623
rec->refname, recfield->fieldname)));
46254624
*typeid = SPI_gettypeid(rec->tupdesc, fno);
4626-
/* XXX there's no SPI_gettypmod, for some reason */
46274625
if (fno > 0)
46284626
*typmod = rec->tupdesc->attrs[fno - 1]->atttypmod;
46294627
else
46304628
*typmod = -1;
4631-
/* XXX there's no SPI_getcollation either */
46324629
if (fno > 0)
46334630
*collation = rec->tupdesc->attrs[fno - 1]->attcollation;
46344631
else /* no system column types have collation */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy