diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-03-26 18:28:40 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-03-26 18:28:40 -0400 |
commit | 7208fae18f1fdb242b4fcced77a3b836e15ac3ec (patch) | |
tree | e857033e3c74a3f73de3e29720290ee721199df3 /src/backend/access/common/tupdesc.c | |
parent | 0c9d9e8dd655fff7bcfc401e82838b8c20c16939 (diff) | |
download | postgresql-7208fae18f1fdb242b4fcced77a3b836e15ac3ec.tar.gz postgresql-7208fae18f1fdb242b4fcced77a3b836e15ac3ec.zip |
Clean up cruft around collation initialization for tupdescs and scankeys.
I found actual bugs in GiST and plpgsql; the rest of this is cosmetic
but meant to decrease the odds of future bugs of omission.
Diffstat (limited to 'src/backend/access/common/tupdesc.c')
-rw-r--r-- | src/backend/access/common/tupdesc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c index d78b08381e0..c06a0271ca5 100644 --- a/src/backend/access/common/tupdesc.c +++ b/src/backend/access/common/tupdesc.c @@ -427,6 +427,10 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2) * TupleDescInitEntry * This function initializes a single attribute structure in * a previously allocated tuple descriptor. + * + * Note that attcollation is set to the default for the specified datatype. + * If a nondefault collation is needed, insert it afterwards using + * TupleDescInitEntryCollation. */ void TupleDescInitEntry(TupleDesc desc, @@ -496,8 +500,8 @@ TupleDescInitEntry(TupleDesc desc, /* * TupleDescInitEntryCollation * - * Fill in the collation for an attribute in a previously initialized - * tuple descriptor. + * Assign a nondefault collation to a previously initialized tuple descriptor + * entry. */ void TupleDescInitEntryCollation(TupleDesc desc, @@ -571,9 +575,9 @@ BuildDescForRelation(List *schema) TupleDescInitEntry(desc, attnum, attname, atttypid, atttypmod, attdim); - TupleDescInitEntryCollation(desc, attnum, attcollation); /* Override TupleDescInitEntry's settings as requested */ + TupleDescInitEntryCollation(desc, attnum, attcollation); if (entry->storage) desc->attrs[attnum - 1]->attstorage = entry->storage; |