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

Commit0813fcb

Browse files
committed
Documentation updates to reflect TOAST and new-style fmgr.
1 parent481487b commit0813fcb

File tree

7 files changed

+474
-177
lines changed

7 files changed

+474
-177
lines changed

‎doc/src/sgml/array.sgml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ UPDATE sal_emp SET pay_by_quarter[1:2] = '{27000,27000}'
130130
</Para>
131131

132132
<Para>
133-
It is not currently possible to resize an array value except by
134-
complete replacement; for example, we couldn't change a four-
135-
element array value to a five-element value with a single
136-
assignment to array[5].
133+
An array can be enlarged by assigning to an element adjacent to
134+
those already present, or by assigning to a slice that is adjacent
135+
to or overlaps the data already present. Currently, this is only
136+
allowed for one-dimensional arrays, not multidimensional arrays.
137+
For example, if an array value currently has 4 elements, it will
138+
have five elements after an update that assigns to array[5].
137139
</Para>
138140

139141
<Para>

‎doc/src/sgml/datatype.sgml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.34 2000/08/24 23:36:28 tgl Exp $
33
-->
44

55
<chapter id="datatype">
@@ -42,7 +42,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
4242
<thead>
4343
<row>
4444
<entry><productname>Postgres</productname> Type</entry>
45-
<entry><acronym>SQL92</acronym> or <acronym>SQL3</acronym> Type</entry>
45+
<entry><acronym>SQL92</acronym> or <acronym>SQL99</acronym> Type</entry>
4646
<entry>Description</entry>
4747
</row>
4848
</thead>
@@ -80,7 +80,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
8080
<row>
8181
<entry>decimal</entry>
8282
<entry>decimal(p,s)</entry>
83-
<entry>exact numericfor p <= 9, s = 0</entry>
83+
<entry>exact numericwith selectable precision</entry>
8484
</row>
8585
<row>
8686
<entry>float4</entry>
@@ -135,7 +135,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
135135
<row>
136136
<entry>numeric</entry>
137137
<entry>numeric(p,s)</entry>
138-
<entry>exact numericfor p == 9, s = 0</entry>
138+
<entry>exact numericwith selectable precision</entry>
139139
</row>
140140
<row>
141141
<entry>path</entry>
@@ -157,6 +157,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
157157
<entry></entry>
158158
<entry>unique id for indexing and cross-reference</entry>
159159
</row>
160+
<row>
161+
<entry>text</entry>
162+
<entry></entry>
163+
<entry>variable-length character string</entry>
164+
</row>
160165
<row>
161166
<entry>time</entry>
162167
<entry>time [ without time zone ]</entry>
@@ -234,7 +239,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
234239
<para>
235240
<productname>Postgres</productname> has features at the forefront of
236241
<acronym>ORDBMS</acronym> development. In addition to
237-
<acronym>SQL3</acronym> conformance, substantial portions
242+
<acronym>SQL99</acronym> conformance, substantial portions
238243
of <acronym>SQL92</acronym> are also supported.
239244
Although we strive for <acronym>SQL92</acronym> compliance,
240245
there are some aspects of the standard
@@ -275,7 +280,8 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
275280
<title>Numeric Types</title>
276281

277282
<para>
278-
Numeric types consist of two- and four-byte integers, four- and eight-byte
283+
Numeric types consist of two-, four-, and eight-byte integers,
284+
four- and eight-byte
279285
floating point numbers and fixed-precision decimals.
280286
</para>
281287

@@ -297,7 +303,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
297303
<entry>decimal</entry>
298304
<entry>variable</entry>
299305
<entry>User-specified precision</entry>
300-
<entry>~8000 digits</entry>
306+
<entry>no limit</entry>
301307
</row>
302308
<row>
303309
<entry>float4</entry>
@@ -327,7 +333,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
327333
<entry>int8</entry>
328334
<entry>8 bytes</entry>
329335
<entry>Very large range fixed-precision</entry>
330-
<entry>+/- &gt;18 decimal places</entry>
336+
<entry>~18 decimal places</entry>
331337
</row>
332338
<row>
333339
<entry>numeric</entry>
@@ -354,7 +360,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.33 2000/08/23 05:59:01 th
354360

355361
<para>
356362
The <type>int8</type> type may not be available on all platforms since
357-
it relies on compiler support forthis.
363+
it relies on compiler support foreight-byte integers.
358364
</para>
359365

360366
<sect2>
@@ -483,7 +489,7 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
483489
</thead>
484490
<tbody>
485491
<row>
486-
<entry>char</entry>
492+
<entry>"char"</entry>
487493
<entry>1 byte</entry>
488494
<entry><acronym>SQL92</acronym>-compatible</entry>
489495
<entry>Single character</entry>
@@ -502,7 +508,7 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
502508
</row>
503509
<row>
504510
<entry>varchar(n)</entry>
505-
<entry>(4+n) bytes</entry>
511+
<entry>(4+x) bytes</entry>
506512
<entry><acronym>SQL92</acronym>-compatible</entry>
507513
<entry>Variable-length with limit</entry>
508514
</row>
@@ -1359,10 +1365,10 @@ January 8 04:05:06 1999 PST
13591365

13601366
<para>
13611367
<productname>Postgres</productname> supports <type>bool</type> as
1362-
the <acronym>SQL3</acronym> boolean type.
1368+
the <acronym>SQL99</acronym> boolean type.
13631369
<type>bool</type> can have one of only two states: 'true' or 'false'.
13641370
A third state, 'unknown', is not
1365-
implemented and is not suggested in <acronym>SQL3</acronym>;
1371+
implemented and is not suggested in <acronym>SQL99</acronym>;
13661372
<acronym>NULL</acronym> is an
13671373
effective substitute. <type>bool</type> can be used in any boolean expression,
13681374
and boolean expressions

‎doc/src/sgml/ref/create_function.sgml

Lines changed: 75 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.15 2000/07/22 04:30:27 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.16 2000/08/24 23:36:29 tgl Exp $
33
Postgres documentation
44
-->
55

@@ -31,7 +31,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
3131
CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">ftype</replaceable> [, ...] ] )
3232
RETURNS <replaceable class="parameter">rtype</replaceable>
3333
AS <replaceable class="parameter">obj_file</replaceable> , <replaceable class="parameter">link_symbol</replaceable>
34-
LANGUAGE 'C'
34+
LANGUAGE 'langname'
3535
[ WITH ( <replaceable class="parameter">attribute</replaceable> [, ...] ) ]
3636
</synopsis>
3737

@@ -57,11 +57,11 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
5757
<term><replaceable class="parameter">ftype</replaceable></term>
5858
<listitem>
5959
<para>
60-
The data type of function arguments.
60+
The data type(s) ofthefunction's arguments, if any.
6161
The input types may be base or complex types, or
6262
<firstterm>opaque</firstterm>.
6363
<literal>opaque</literal> indicates that the function
64-
accepts arguments ofan invalid type such as <type>char *</type>.
64+
accepts arguments ofa non-SQL type such as <type>char *</type>.
6565
</para>
6666
</listitem>
6767
</varlistentry>
@@ -84,14 +84,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
8484
<listitem>
8585
<para>
8686
An optional piece of information about the function, used for
87-
optimization. The only attribute currently supported is
88-
<literal>iscachable</literal>.
89-
<literal>iscachable</literal> indicates that the function always
90-
returns the same result when given the same input values (i.e.,
91-
it does not do database lookups or otherwise use information not
92-
directly present in its parameter list). The optimizer uses
93-
<literal>iscachable</literal> to know whether it is safe to
94-
pre-evaluate a call of the function.
87+
optimization. See below for details.
9588
</para>
9689
</listitem>
9790
</varlistentry>
@@ -115,8 +108,8 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
115108
function. The string <replaceable
116109
class="parameter">obj_file</replaceable> is the name of the file
117110
containing the dynamically loadable object, and <replaceable
118-
class="parameter">link_symbol</replaceable>, is the object's link
119-
symbol which is the same as the name of the function in the C
111+
class="parameter">link_symbol</replaceable> is the object's link
112+
symbol, that is the name of the function in the C
120113
language source code.
121114
</para>
122115
</listitem>
@@ -125,8 +118,9 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
125118
<term><replaceable class="parameter">langname</replaceable></term>
126119
<listitem>
127120
<para>
128-
may be '<literal>C</literal>', '<literal>sql</literal>',
129-
'<literal>internal</literal>'
121+
may be '<literal>sql</literal>',
122+
'<literal>C</literal>', '<literal>newC</literal>',
123+
'<literal>internal</literal>', '<literal>newinternal</literal>',
130124
or '<replaceable class="parameter">plname</replaceable>',
131125
where '<replaceable class="parameter">plname</replaceable>'
132126
is the name of a created procedural language. See
@@ -175,11 +169,57 @@ CREATE
175169
<command>CREATE FUNCTION</command> allows a
176170
<productname>Postgres</productname> user
177171
to register a function
178-
witha database. Subsequently, this user is considered the
172+
withthe database. Subsequently, this user is considered the
179173
owner of the function.
180174
</para>
181-
175+
182176
<refsect2 id="R2-SQL-CREATEFUNCTION-3">
177+
<refsect2info>
178+
<date>2000-08-24</date>
179+
</refsect2info>
180+
<title>
181+
Function Attributes
182+
</title>
183+
184+
<para>
185+
The following items may appear in the WITH clause:
186+
187+
<variablelist>
188+
<varlistentry>
189+
<literal>iscachable</literal>
190+
<listitem>
191+
<para>
192+
<literal>iscachable</literal> indicates that the function always
193+
returns the same result when given the same argument values (i.e.,
194+
it does not do database lookups or otherwise use information not
195+
directly present in its parameter list). The optimizer uses
196+
<literal>iscachable</literal> to know whether it is safe to
197+
pre-evaluate a call of the function.
198+
</para>
199+
</listitem>
200+
</varlistentry>
201+
202+
<varlistentry>
203+
<literal>isstrict</literal>
204+
<listitem>
205+
<para>
206+
<literal>isstrict</literal> indicates that the function always
207+
returns NULL whenever any of its arguments are NULL. If this
208+
attribute is specified, the function is not executed when there
209+
are NULL arguments; instead a NULL result is assumed automatically.
210+
When <literal>isstrict</literal> is not specified, the function will
211+
be called for NULL inputs. It is then the function author's
212+
responsibility to check for NULLs if necessary and respond
213+
appropriately.
214+
</para>
215+
</listitem>
216+
</varlistentry>
217+
</variablelist>
218+
</para>
219+
220+
</refsect2>
221+
222+
<refsect2 id="R2-SQL-CREATEFUNCTION-4">
183223
<refsect2info>
184224
<date>2000-03-25</date>
185225
</refsect2info>
@@ -200,26 +240,25 @@ CREATE
200240
to remove user-defined functions.
201241
</para>
202242

203-
<para>
204-
<productname>Postgres</productname> allows function "overloading";
205-
that is, the same name can be used for several different functions
206-
so long as they have distinct argument types. This facility must
207-
be used with caution for <literal>internal</literal> and
208-
C-language functions, however.
209-
</para>
210-
211243
<para>
212244
The full <acronym>SQL92</acronym> type syntax is allowed for
213245
input arguments and return value. However, some details of the
214246
type specification (e.g. the precision field for
215247
<type>numeric</type> types) are the responsibility of the
216248
underlying function implementation and are silently swallowed
217-
(e.g. not recognized or
249+
(i.e., not recognized or
218250
enforced) by the <command>CREATE FUNCTION</command> command.
219251
</para>
220252

221253
<para>
222-
Two <literal>internal</literal>
254+
<productname>Postgres</productname> allows function "overloading";
255+
that is, the same name can be used for several different functions
256+
so long as they have distinct argument types. This facility must
257+
be used with caution for internal and C-language functions, however.
258+
</para>
259+
260+
<para>
261+
Two <literal>internal</literal> or <literal>newinternal</literal>
223262
functions cannot have the same C name without causing
224263
errors at link time. To get around that, give them different C names
225264
(for example, use the argument types as part of the C names), then
@@ -229,18 +268,14 @@ CREATE
229268
</para>
230269

231270
<para>
232-
When overloading SQL functions with C-language functions, give
233-
each C-language instance of the function a distinct name, and use
271+
Similarly, when overloading SQL function names with multiple C-language
272+
functions, give
273+
each C-language instance of the function a distinct name, then use
234274
the alternative form of the <command>AS</command> clause in the
235-
<command>CREATE FUNCTION</command> syntax to ensure that
236-
overloaded SQL functions names are resolved to the correct
237-
dynamically linked objects.
275+
<command>CREATE FUNCTION</command> syntax to select the appropriate
276+
C-language implementation of each overloaded SQL function.
238277
</para>
239278

240-
241-
<para>
242-
A C function cannot return a set of values.
243-
</para>
244279
</refsect2>
245280
</refsect1>
246281

@@ -291,7 +326,7 @@ CREATE TABLE product (
291326
function is implemented by a dynamically loaded object that was
292327
compiled from C source. For <productname>Postgres</productname> to
293328
find a type conversion function automatically, the sql function has
294-
to have the same name as the return type, and overloading is
329+
to have the same name as the return type, andsooverloading is
295330
unavoidable. The function name is overloaded by using the second
296331
form of the <command>AS</command> clause in the SQL definition:
297332
</para>
@@ -324,7 +359,7 @@ Point * complex_to_point (Complex *z)
324359
Compatibility
325360
</title>
326361

327-
<refsect2 id="R2-SQL-CREATEFUNCTION-4">
362+
<refsect2 id="R2-SQL-CREATEFUNCTION-5">
328363
<refsect2info>
329364
<date>2000-03-25</date>
330365
</refsect2info>
@@ -338,7 +373,7 @@ Point * complex_to_point (Complex *z)
338373
</para>
339374
</refsect2>
340375

341-
<refsect2 id="R2-SQL-CREATEFUNCTION-5">
376+
<refsect2 id="R2-SQL-CREATEFUNCTION-6">
342377
<refsect2info>
343378
<date>2000-03-25</date>
344379
</refsect2info>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp