Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69cf335

Browse files
committed
Documentation updates to reflect TOAST and new-style fmgr.
1 parent0813fcb commit69cf335

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

‎doc/src/sgml/trigger.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,13 @@ trigf(PG_FUNCTION_ARGS)
509509
</para>
510510

511511
<para>
512-
Now, compile and
513-
create table ttest (x int4):
512+
Now, compile and create the trigger function:
514513

515514
<programlisting>
516515
create function trigf () returns opaque as
517-
'...path_to_so' language 'c';
516+
'...path_to_so' language 'newC';
517+
518+
create table ttest (x int4);
518519
</programlisting>
519520

520521
<programlisting>

‎doc/src/sgml/xtypes.sgml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ complex_in(char *str)
5555
double x, y;
5656
Complex *result;
5757
if (sscanf(str, " ( %lf , %lf )", &amp;x, &amp;y) != 2) {
58-
elog(NOTICE, "complex_in: error in parsing
58+
elog(ERROR, "complex_in: error in parsing %s", str);
5959
return NULL;
6060
}
6161
result = (Complex *)palloc(sizeof(Complex));
@@ -138,22 +138,16 @@ CREATE TYPE complex (
138138
<title>Large Objects</title>
139139

140140
<para>
141-
The types discussed to this point are all "small"
142-
objects -- that is, they are smaller than 8KB in size.
143-
<note>
144-
<para>
145-
1024 longwords == 8192 bytes. In fact, the type must be considerably smaller than 8192 bytes,
146-
since the <productname>Postgres</productname> tuple
147-
and page overhead must also fit into this 8KB limitation.
148-
The actual value that fits depends on the machine architecture.
149-
</para>
150-
</note>
151-
If you require a larger type for something like a document
152-
retrieval system or for storing bitmaps, you will
153-
need to use the <productname>Postgres</productname> large object
154-
interface, or will need to recompile the
155-
<productname>Postgres</productname> backend to use internal
156-
storage blocks greater than 8kbytes..
141+
If the values of your datatype might exceed a few hundred bytes in
142+
size (in internal form), you should be careful to mark them TOASTable.
143+
To do this, the internal representation must follow the standard
144+
layout for variable-length data: the first four bytes must be an int32
145+
containing the total length in bytes of the datum (including itself).
146+
Then, all your functions that accept values of the type must be careful
147+
to call pg_detoast_datum() on the supplied values --- after checking
148+
that the value is not NULL, if your function is not strict. Finally,
149+
select the appropriate storage option when giving the CREATE TYPE
150+
command.
157151
</para>
158152
</sect2>
159153
</sect1>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp