postgresql/src/backend/commands
Tom Lane bac3e83622 Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation.  Instead put the information into two new pg_type columns,
typcategory and typispreferred.  Add support for setting these when
creating a user-defined base type.

The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character.  This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.

In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums.  In particular the default preferred state
for user-defined types remains TRUE.  That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 17:05:05 +00:00
..
aggregatecmds.c ALTER AGGREGATE OWNER seems to have been missed by the last couple of 2008-06-08 21:09:48 +00:00
alter.c Rearrange ALTER TABLE syntax processing as per my recent proposal: the 2008-06-15 01:25:54 +00:00
analyze.c Extend VacAttrStats to allow typanalyze functions to store statistic values 2008-07-01 10:33:09 +00:00
async.c Move the HTSU_Result enum definition into snapshot.h, to avoid including 2008-03-26 21:10:39 +00:00
cluster.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
comment.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
conversioncmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
copy.c Improve snapshot manager by keeping explicit track of snapshots. 2008-05-12 20:02:02 +00:00
dbcommands.c Restructure some header files a bit, in particular heapam.h, by removing some 2008-05-12 00:00:54 +00:00
define.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
discard.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
explain.c Move the "instr_time" typedef and associated macros into a new header 2008-05-14 19:10:29 +00:00
functioncmds.c Implement SQL-spec RETURNS TABLE syntax for functions. 2008-07-18 03:32:53 +00:00
indexcmds.c Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType() 2008-07-30 17:05:05 +00:00
lockcmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
Makefile Refactor backend makefiles to remove lots of duplicate code 2008-02-19 10:30:09 +00:00
opclasscmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
operatorcmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
portalcmds.c Adjust things so that the query_string of a cached plan and the sourceText of 2008-07-18 20:26:06 +00:00
prepare.c Add comment about the two different query strings that ExecuteQuery() 2008-07-21 15:26:55 +00:00
proclang.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
schemacmds.c Refactor the handling of the various DropStmt variants so that when multiple 2008-06-14 18:04:34 +00:00
sequence.c Clean up the use of some page-header-access macros: principally, use 2008-07-13 20:45:47 +00:00
tablecmds.c Fix previous patch so that it actually works --- consider TRUNCATE foo, public.foo 2008-07-16 19:33:25 +00:00
tablespace.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
trigger.c Adjust things so that the query_string of a cached plan and the sourceText of 2008-07-18 20:26:06 +00:00
tsearchcmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
typecmds.c Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType() 2008-07-30 17:05:05 +00:00
user.c Restructure some header files a bit, in particular heapam.h, by removing some 2008-05-12 00:00:54 +00:00
vacuum.c Modify vacuum() to accept a single relation OID instead of a list (which we 2008-06-05 15:47:32 +00:00
vacuumlazy.c Restructure some header files a bit, in particular heapam.h, by removing some 2008-05-12 00:00:54 +00:00
variable.c Improve snapshot manager by keeping explicit track of snapshots. 2008-05-12 20:02:02 +00:00
view.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00