summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-06-15 20:56:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-06-15 20:56:52 +0000
commit23347231a53bc373710db71559a194d87f60a7cb (patch)
tree04c6e8af0afb299a0a112da5c92124a377d1abb3 /doc/src
parent839fcc9fd09452c406b67fb2e1af87d55d0ad4e2 (diff)
Tweak the API for per-datatype typmodin functions so that they are passed
an array of strings rather than an array of integers, and allow any simple constant or identifier to be used in typmods; for example create table foo (f1 widget(42,'23skidoo',point)); Of course the typmodin function has still got to pack this info into a non-negative int32 for storage, but it's still a useful improvement in flexibility, especially considering that you can do nearly anything if you are willing to keep the info in a side table. We can get away with this change since we have not yet released a version providing user-definable typmods. Per discussion.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/create_type.sgml10
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml
index 038cf8c256f..be13351d0a2 100644
--- a/doc/src/sgml/ref/create_type.sgml
+++ b/doc/src/sgml/ref/create_type.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.71 2007/05/12 00:54:59 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.72 2007/06/15 20:56:49 tgl Exp $
PostgreSQL documentation
-->
@@ -195,11 +195,11 @@ CREATE TYPE <replaceable class="parameter">name</replaceable>
are needed if the type supports modifiers, that is optional constraints
attached to a type declaration, such as <literal>char(5)</> or
<literal>numeric(30,2)</>. <productname>PostgreSQL</productname> allows
- user-defined types to take one or more integer constants as modifiers;
- however, this information must be capable of being packed into a single
- non-negative integer value for storage in the system catalogs. The
+ user-defined types to take one or more simple constants or identifiers as
+ modifiers; however, this information must be capable of being packed into a
+ single non-negative integer value for storage in the system catalogs. The
<replaceable class="parameter">type_modifier_input_function</replaceable>
- is passed the declared modifier(s) in the form of an <type>integer</>
+ is passed the declared modifier(s) in the form of a <type>cstring</>
array. It must check the values for validity (throwing an error if they
are wrong), and if they are correct, return a single non-negative
<type>integer</> value that will be stored as the column <quote>typmod</>.