mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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.
This commit is contained in:
@ -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</>.
|
||||
|
Reference in New Issue
Block a user