From 69cf335687eb47e80e56aee7804bf0c2c3facec8 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 24 Aug 2000 23:59:38 +0000 Subject: [PATCH] Documentation updates to reflect TOAST and new-style fmgr. --- doc/src/sgml/trigger.sgml | 7 ++++--- doc/src/sgml/xtypes.sgml | 28 +++++++++++----------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/doc/src/sgml/trigger.sgml b/doc/src/sgml/trigger.sgml index 48a4487e46..d7858a7ce5 100644 --- a/doc/src/sgml/trigger.sgml +++ b/doc/src/sgml/trigger.sgml @@ -509,12 +509,13 @@ trigf(PG_FUNCTION_ARGS) - Now, compile and - create table ttest (x int4): + Now, compile and create the trigger function: create function trigf () returns opaque as -'...path_to_so' language 'c'; +'...path_to_so' language 'newC'; + +create table ttest (x int4); diff --git a/doc/src/sgml/xtypes.sgml b/doc/src/sgml/xtypes.sgml index 6af5ae1d44..af307671fa 100644 --- a/doc/src/sgml/xtypes.sgml +++ b/doc/src/sgml/xtypes.sgml @@ -55,7 +55,7 @@ complex_in(char *str) double x, y; Complex *result; if (sscanf(str, " ( %lf , %lf )", &x, &y) != 2) { - elog(NOTICE, "complex_in: error in parsing + elog(ERROR, "complex_in: error in parsing %s", str); return NULL; } result = (Complex *)palloc(sizeof(Complex)); @@ -138,22 +138,16 @@ CREATE TYPE complex ( Large Objects - The types discussed to this point are all "small" - objects -- that is, they are smaller than 8KB in size. - - - 1024 longwords == 8192 bytes. In fact, the type must be considerably smaller than 8192 bytes, - since the Postgres tuple - and page overhead must also fit into this 8KB limitation. - The actual value that fits depends on the machine architecture. - - - If you require a larger type for something like a document - retrieval system or for storing bitmaps, you will - need to use the Postgres large object - interface, or will need to recompile the - Postgres backend to use internal - storage blocks greater than 8kbytes.. + If the values of your datatype might exceed a few hundred bytes in + size (in internal form), you should be careful to mark them TOASTable. + To do this, the internal representation must follow the standard + layout for variable-length data: the first four bytes must be an int32 + containing the total length in bytes of the datum (including itself). + Then, all your functions that accept values of the type must be careful + to call pg_detoast_datum() on the supplied values --- after checking + that the value is not NULL, if your function is not strict. Finally, + select the appropriate storage option when giving the CREATE TYPE + command.