From b1a5f8720987fbfda23c6bfb4a0dd683b9bdae70 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 15 Aug 2002 16:36:08 +0000 Subject: Tom Lane wrote: > There's no longer a separate call to heap_storage_create in that routine > --- the right place to make the test is now in the storage_create > boolean parameter being passed to heap_create. A simple change, but > it passeth patch's understanding ... Thanks. Attached is a patch against cvs tip as of 8:30 PM PST or so. Turned out that even after fixing the failed hunks, there was a new spot in bufmgr.c which needed to be fixed (related to temp relations; RelationUpdateNumberOfBlocks). But thankfully the regression test code caught it :-) Joe Conway --- doc/src/sgml/ref/create_type.sgml | 51 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml index d4860cff80d..9da93a42d28 100644 --- a/doc/src/sgml/ref/create_type.sgml +++ b/doc/src/sgml/ref/create_type.sgml @@ -1,5 +1,5 @@ @@ -30,6 +30,13 @@ CREATE TYPE typename ( INPUT = alignment ] [ , STORAGE = storage ] ) + +CREATE TYPE typename AS + ( column_definition_list ) + +where column_definition_list can be: + +( column_name data_type [, ... ] ) @@ -138,6 +145,25 @@ CREATE TYPE typename ( INPUT = + + + column_name + + + The name of a column of the composite type. + + + + + + data_type + + + The name of an existing data type. + + + + @@ -191,9 +217,9 @@ CREATE TYPE - CREATE TYPE requires the registration of two functions - (using CREATE FUNCTION) before defining the type. The - representation of a new base type is determined by + The first form of CREATE TYPE requires the + registration of two functions (using CREATE FUNCTION) before defining the + type. The representation of a new base type is determined by input_function, which converts the type's external representation to an internal representation usable by the @@ -288,6 +314,14 @@ CREATE TYPE extended and external items.) + + The second form of CREATE TYPE requires a column + definition list in the form ( column_name + data_type [, ... ] ). This + creates a composite type, similar to that of a TABLE or VIEW relation. + A stand-alone composite type is useful as the return type of FUNCTION. + + Array Types @@ -370,6 +404,15 @@ CREATE TYPE box (INTERNALLENGTH = 16, CREATE TYPE bigobj (INPUT = lo_filein, OUTPUT = lo_fileout, INTERNALLENGTH = VARIABLE); CREATE TABLE big_objs (id int4, obj bigobj); + + + + + This example creates a composite type and uses it in + a table function definition: + +CREATE TYPE compfoo AS (f1 int, f2 int); +CREATE FUNCTION getfoo() RETURNS SETOF compfoo AS 'SELECT fooid, foorefid FROM foo' LANGUAGE SQL; -- cgit v1.2.3