mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Remove trailing whitespace from *.sgml files.
Historically we've been lax about this, but seeing that we're not
lax in C files, there doesn't seem to be a good reason to be so
in the documentation. Remove the existing occurrences (mostly
though not entirely in copied-n-pasted psql output), and modify
.gitattributes so that "git diff --check" will warn about future
cases.
While at it, add *.pm to the set of extensions .gitattributes
knows about, and remove some obsolete entries for files that
we don't have in the tree anymore.
Per followup discussion of commit 5a892c9b1
.
Discussion: https://postgr.es/m/E1nfcV1-000kOR-E5@gemulon.postgresql.org
This commit is contained in:
7
.gitattributes
vendored
7
.gitattributes
vendored
@@ -1,8 +1,9 @@
|
|||||||
* whitespace=space-before-tab,trailing-space
|
* whitespace=space-before-tab,trailing-space
|
||||||
*.[chly] whitespace=space-before-tab,trailing-space,indent-with-non-tab,tabwidth=4
|
*.[chly] whitespace=space-before-tab,trailing-space,indent-with-non-tab,tabwidth=4
|
||||||
*.pl whitespace=space-before-tab,trailing-space,tabwidth=4
|
*.pl whitespace=space-before-tab,trailing-space,tabwidth=4
|
||||||
|
*.pm whitespace=space-before-tab,trailing-space,tabwidth=4
|
||||||
*.po whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eof
|
*.po whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eof
|
||||||
*.sgml whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eol
|
*.sgml whitespace=space-before-tab,trailing-space,tab-in-indent
|
||||||
*.x[ms]l whitespace=space-before-tab,trailing-space,tab-in-indent
|
*.x[ms]l whitespace=space-before-tab,trailing-space,tab-in-indent
|
||||||
|
|
||||||
# Avoid confusing ASCII underlines with leftover merge conflict markers
|
# Avoid confusing ASCII underlines with leftover merge conflict markers
|
||||||
@@ -17,9 +18,6 @@ src/backend/utils/Gen_dummy_probes.pl.prolog whitespace=-blank-at-eof
|
|||||||
|
|
||||||
# Test output files that contain extra whitespace
|
# Test output files that contain extra whitespace
|
||||||
*.out -whitespace
|
*.out -whitespace
|
||||||
contrib/*/output/*.source -whitespace
|
|
||||||
src/pl/plpgsql/src/output/*.source -whitespace
|
|
||||||
src/test/regress/output/*.source -whitespace
|
|
||||||
src/interfaces/ecpg/test/expected/* -whitespace
|
src/interfaces/ecpg/test/expected/* -whitespace
|
||||||
src/interfaces/libpq/test/expected.out whitespace=-blank-at-eof
|
src/interfaces/libpq/test/expected.out whitespace=-blank-at-eof
|
||||||
|
|
||||||
@@ -27,7 +25,6 @@ src/interfaces/libpq/test/expected.out whitespace=-blank-at-eof
|
|||||||
configure -whitespace
|
configure -whitespace
|
||||||
ppport.h -whitespace
|
ppport.h -whitespace
|
||||||
src/backend/regex/COPYRIGHT -whitespace
|
src/backend/regex/COPYRIGHT -whitespace
|
||||||
src/backend/regex/re_syntax.n -whitespace
|
|
||||||
src/backend/snowball/libstemmer/*.c -whitespace
|
src/backend/snowball/libstemmer/*.c -whitespace
|
||||||
src/backend/utils/mb/Unicode/*-std.txt -whitespace
|
src/backend/utils/mb/Unicode/*-std.txt -whitespace
|
||||||
src/include/snowball/libstemmer/* -whitespace
|
src/include/snowball/libstemmer/* -whitespace
|
||||||
|
@@ -344,7 +344,7 @@ SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM emps
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
depname | empno | salary | avg
|
depname | empno | salary | avg
|
||||||
-----------+-------+--------+-----------------------
|
-----------+-------+--------+-----------------------
|
||||||
develop | 11 | 5200 | 5020.0000000000000000
|
develop | 11 | 5200 | 5020.0000000000000000
|
||||||
develop | 7 | 4200 | 5020.0000000000000000
|
develop | 7 | 4200 | 5020.0000000000000000
|
||||||
@@ -394,7 +394,7 @@ FROM empsalary;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
depname | empno | salary | rank
|
depname | empno | salary | rank
|
||||||
-----------+-------+--------+------
|
-----------+-------+--------+------
|
||||||
develop | 8 | 6000 | 1
|
develop | 8 | 6000 | 1
|
||||||
develop | 10 | 5200 | 2
|
develop | 10 | 5200 | 2
|
||||||
@@ -458,7 +458,7 @@ SELECT salary, sum(salary) OVER () FROM empsalary;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
salary | sum
|
salary | sum
|
||||||
--------+-------
|
--------+-------
|
||||||
5200 | 47100
|
5200 | 47100
|
||||||
5000 | 47100
|
5000 | 47100
|
||||||
@@ -487,7 +487,7 @@ SELECT salary, sum(salary) OVER (ORDER BY salary) FROM empsalary;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
salary | sum
|
salary | sum
|
||||||
--------+-------
|
--------+-------
|
||||||
3500 | 3500
|
3500 | 3500
|
||||||
3900 | 7400
|
3900 | 7400
|
||||||
|
@@ -929,7 +929,7 @@ SELECT * FROM pg_backup_stop(wait_for_archive => true);
|
|||||||
<filename>backup_label</filename> in the root directory of the backup. The
|
<filename>backup_label</filename> in the root directory of the backup. The
|
||||||
third field should be written to a file named
|
third field should be written to a file named
|
||||||
<filename>tablespace_map</filename> unless the field is empty. These files are
|
<filename>tablespace_map</filename> unless the field is empty. These files are
|
||||||
vital to the backup working and must be written byte for byte without
|
vital to the backup working and must be written byte for byte without
|
||||||
modification, which may require opening the file in binary mode.
|
modification, which may require opening the file in binary mode.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@@ -116,7 +116,7 @@ SELECT 10000000
|
|||||||
A sequential scan over this large table takes a long time:
|
A sequential scan over this large table takes a long time:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;-----------------------------------
|
-------------------------------------------------------------------&zwsp;-----------------------------------
|
||||||
Seq Scan on tbloom (cost=0.00..2137.14 rows=3 width=24) (actual time=16.971..16.971 rows=0 loops=1)
|
Seq Scan on tbloom (cost=0.00..2137.14 rows=3 width=24) (actual time=16.971..16.971 rows=0 loops=1)
|
||||||
Filter: ((i2 = 898732) AND (i5 = 123451))
|
Filter: ((i2 = 898732) AND (i5 = 123451))
|
||||||
@@ -139,7 +139,7 @@ CREATE INDEX
|
|||||||
3976 kB
|
3976 kB
|
||||||
(1 row)
|
(1 row)
|
||||||
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;-----------------------------------
|
-------------------------------------------------------------------&zwsp;-----------------------------------
|
||||||
Seq Scan on tbloom (cost=0.00..2137.00 rows=2 width=24) (actual time=12.805..12.805 rows=0 loops=1)
|
Seq Scan on tbloom (cost=0.00..2137.00 rows=2 width=24) (actual time=12.805..12.805 rows=0 loops=1)
|
||||||
Filter: ((i2 = 898732) AND (i5 = 123451))
|
Filter: ((i2 = 898732) AND (i5 = 123451))
|
||||||
@@ -162,7 +162,7 @@ CREATE INDEX
|
|||||||
1584 kB
|
1584 kB
|
||||||
(1 row)
|
(1 row)
|
||||||
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;--------------------------------------------------
|
-------------------------------------------------------------------&zwsp;--------------------------------------------------
|
||||||
Bitmap Heap Scan on tbloom (cost=1792.00..1799.69 rows=2 width=24) (actual time=0.388..0.388 rows=0 loops=1)
|
Bitmap Heap Scan on tbloom (cost=1792.00..1799.69 rows=2 width=24) (actual time=0.388..0.388 rows=0 loops=1)
|
||||||
Recheck Cond: ((i2 = 898732) AND (i5 = 123451))
|
Recheck Cond: ((i2 = 898732) AND (i5 = 123451))
|
||||||
@@ -195,7 +195,7 @@ CREATE INDEX
|
|||||||
=# CREATE INDEX btreeidx6 ON tbloom (i6);
|
=# CREATE INDEX btreeidx6 ON tbloom (i6);
|
||||||
CREATE INDEX
|
CREATE INDEX
|
||||||
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;--------------------------------------------------------
|
-------------------------------------------------------------------&zwsp;--------------------------------------------------------
|
||||||
Bitmap Heap Scan on tbloom (cost=24.34..32.03 rows=2 width=24) (actual time=0.028..0.029 rows=0 loops=1)
|
Bitmap Heap Scan on tbloom (cost=24.34..32.03 rows=2 width=24) (actual time=0.028..0.029 rows=0 loops=1)
|
||||||
Recheck Cond: ((i5 = 123451) AND (i2 = 898732))
|
Recheck Cond: ((i5 = 123451) AND (i2 = 898732))
|
||||||
|
@@ -1574,13 +1574,13 @@ CREATE DATABASE korean WITH ENCODING 'EUC_KR' LC_COLLATE='ko_KR.euckr' LC_CTYPE=
|
|||||||
<screen>
|
<screen>
|
||||||
$ <userinput>psql -l</userinput>
|
$ <userinput>psql -l</userinput>
|
||||||
List of databases
|
List of databases
|
||||||
Name | Owner | Encoding | Collation | Ctype | Access Privileges
|
Name | Owner | Encoding | Collation | Ctype | Access Privileges
|
||||||
-----------+----------+-----------+-------------+-------------+-------------------------------------
|
-----------+----------+-----------+-------------+-------------+-------------------------------------
|
||||||
clocaledb | hlinnaka | SQL_ASCII | C | C |
|
clocaledb | hlinnaka | SQL_ASCII | C | C |
|
||||||
englishdb | hlinnaka | UTF8 | en_GB.UTF8 | en_GB.UTF8 |
|
englishdb | hlinnaka | UTF8 | en_GB.UTF8 | en_GB.UTF8 |
|
||||||
japanese | hlinnaka | UTF8 | ja_JP.UTF8 | ja_JP.UTF8 |
|
japanese | hlinnaka | UTF8 | ja_JP.UTF8 | ja_JP.UTF8 |
|
||||||
korean | hlinnaka | EUC_KR | ko_KR.euckr | ko_KR.euckr |
|
korean | hlinnaka | EUC_KR | ko_KR.euckr | ko_KR.euckr |
|
||||||
postgres | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 |
|
postgres | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 |
|
||||||
template0 | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 | {=c/hlinnaka,hlinnaka=CTc/hlinnaka}
|
template0 | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 | {=c/hlinnaka,hlinnaka=CTc/hlinnaka}
|
||||||
template1 | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 | {=c/hlinnaka,hlinnaka=CTc/hlinnaka}
|
template1 | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 | {=c/hlinnaka,hlinnaka=CTc/hlinnaka}
|
||||||
(7 rows)
|
(7 rows)
|
||||||
|
@@ -3177,7 +3177,7 @@ CREATE TABLE person (
|
|||||||
);
|
);
|
||||||
INSERT INTO person VALUES ('Moe', 'happy');
|
INSERT INTO person VALUES ('Moe', 'happy');
|
||||||
SELECT * FROM person WHERE current_mood = 'happy';
|
SELECT * FROM person WHERE current_mood = 'happy';
|
||||||
name | current_mood
|
name | current_mood
|
||||||
------+--------------
|
------+--------------
|
||||||
Moe | happy
|
Moe | happy
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -3198,14 +3198,14 @@ SELECT * FROM person WHERE current_mood = 'happy';
|
|||||||
INSERT INTO person VALUES ('Larry', 'sad');
|
INSERT INTO person VALUES ('Larry', 'sad');
|
||||||
INSERT INTO person VALUES ('Curly', 'ok');
|
INSERT INTO person VALUES ('Curly', 'ok');
|
||||||
SELECT * FROM person WHERE current_mood > 'sad';
|
SELECT * FROM person WHERE current_mood > 'sad';
|
||||||
name | current_mood
|
name | current_mood
|
||||||
-------+--------------
|
-------+--------------
|
||||||
Moe | happy
|
Moe | happy
|
||||||
Curly | ok
|
Curly | ok
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
SELECT * FROM person WHERE current_mood > 'sad' ORDER BY current_mood;
|
SELECT * FROM person WHERE current_mood > 'sad' ORDER BY current_mood;
|
||||||
name | current_mood
|
name | current_mood
|
||||||
-------+--------------
|
-------+--------------
|
||||||
Curly | ok
|
Curly | ok
|
||||||
Moe | happy
|
Moe | happy
|
||||||
@@ -3214,7 +3214,7 @@ SELECT * FROM person WHERE current_mood > 'sad' ORDER BY current_mood;
|
|||||||
SELECT name
|
SELECT name
|
||||||
FROM person
|
FROM person
|
||||||
WHERE current_mood = (SELECT MIN(current_mood) FROM person);
|
WHERE current_mood = (SELECT MIN(current_mood) FROM person);
|
||||||
name
|
name
|
||||||
-------
|
-------
|
||||||
Larry
|
Larry
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -3253,7 +3253,7 @@ ERROR: operator does not exist: mood = happiness
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT person.name, holidays.num_weeks FROM person, holidays
|
SELECT person.name, holidays.num_weeks FROM person, holidays
|
||||||
WHERE person.current_mood::text = holidays.happiness::text;
|
WHERE person.current_mood::text = holidays.happiness::text;
|
||||||
name | num_weeks
|
name | num_weeks
|
||||||
------+-----------
|
------+-----------
|
||||||
Moe | 4
|
Moe | 4
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -3982,7 +3982,7 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT macaddr8_set7bit('08:00:2b:01:02:03');
|
SELECT macaddr8_set7bit('08:00:2b:01:02:03');
|
||||||
<computeroutput>
|
<computeroutput>
|
||||||
macaddr8_set7bit
|
macaddr8_set7bit
|
||||||
-------------------------
|
-------------------------
|
||||||
0a:00:2b:ff:fe:01:02:03
|
0a:00:2b:ff:fe:01:02:03
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -4124,7 +4124,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat'::tsvector;
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT $$the lexeme ' ' contains spaces$$::tsvector;
|
SELECT $$the lexeme ' ' contains spaces$$::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
' ' 'contains' 'lexeme' 'spaces' 'the'
|
' ' 'contains' 'lexeme' 'spaces' 'the'
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -4135,7 +4135,7 @@ SELECT $$the lexeme ' ' contains spaces$$::tsvector;
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT $$the lexeme 'Joe''s' contains a quote$$::tsvector;
|
SELECT $$the lexeme 'Joe''s' contains a quote$$::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
'Joe''s' 'a' 'contains' 'lexeme' 'quote' 'the'
|
'Joe''s' 'a' 'contains' 'lexeme' 'quote' 'the'
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -4165,7 +4165,7 @@ SELECT 'a:1 fat:2 cat:3 sat:4 on:5 a:6 mat:7 and:8 ate:9 a:10 fat:11 rat:12'::ts
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT 'a:1A fat:2B,4C cat:5D'::tsvector;
|
SELECT 'a:1A fat:2B,4C cat:5D'::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
----------------------------
|
----------------------------
|
||||||
'a':1A 'cat':5 'fat':2B,4C
|
'a':1A 'cat':5 'fat':2B,4C
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -4184,7 +4184,7 @@ SELECT 'a:1A fat:2B,4C cat:5D'::tsvector;
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT 'The Fat Rats'::tsvector;
|
SELECT 'The Fat Rats'::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
--------------------
|
--------------------
|
||||||
'Fat' 'Rats' 'The'
|
'Fat' 'Rats' 'The'
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -4197,7 +4197,7 @@ SELECT 'The Fat Rats'::tsvector;
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT to_tsvector('english', 'The Fat Rats');
|
SELECT to_tsvector('english', 'The Fat Rats');
|
||||||
to_tsvector
|
to_tsvector
|
||||||
-----------------
|
-----------------
|
||||||
'fat':2 'rat':3
|
'fat':2 'rat':3
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -4239,17 +4239,17 @@ SELECT to_tsvector('english', 'The Fat Rats');
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT 'fat & rat'::tsquery;
|
SELECT 'fat & rat'::tsquery;
|
||||||
tsquery
|
tsquery
|
||||||
---------------
|
---------------
|
||||||
'fat' & 'rat'
|
'fat' & 'rat'
|
||||||
|
|
||||||
SELECT 'fat & (rat | cat)'::tsquery;
|
SELECT 'fat & (rat | cat)'::tsquery;
|
||||||
tsquery
|
tsquery
|
||||||
---------------------------
|
---------------------------
|
||||||
'fat' & ( 'rat' | 'cat' )
|
'fat' & ( 'rat' | 'cat' )
|
||||||
|
|
||||||
SELECT 'fat & rat & ! cat'::tsquery;
|
SELECT 'fat & rat & ! cat'::tsquery;
|
||||||
tsquery
|
tsquery
|
||||||
------------------------
|
------------------------
|
||||||
'fat' & 'rat' & !'cat'
|
'fat' & 'rat' & !'cat'
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -4273,7 +4273,7 @@ SELECT 'fat:ab & cat'::tsquery;
|
|||||||
to specify prefix matching:
|
to specify prefix matching:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT 'super:*'::tsquery;
|
SELECT 'super:*'::tsquery;
|
||||||
tsquery
|
tsquery
|
||||||
-----------
|
-----------
|
||||||
'super':*
|
'super':*
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -4290,7 +4290,7 @@ SELECT 'super:*'::tsquery;
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT to_tsquery('Fat:ab & Cats');
|
SELECT to_tsquery('Fat:ab & Cats');
|
||||||
to_tsquery
|
to_tsquery
|
||||||
------------------
|
------------------
|
||||||
'fat':AB & 'cat'
|
'fat':AB & 'cat'
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@@ -161,13 +161,13 @@ GRANT SELECT ON TABLE foo TO regress_dblink_user;
|
|||||||
\set ORIGINAL_USER :USER
|
\set ORIGINAL_USER :USER
|
||||||
\c - regress_dblink_user
|
\c - regress_dblink_user
|
||||||
SELECT dblink_connect('myconn', 'fdtest');
|
SELECT dblink_connect('myconn', 'fdtest');
|
||||||
dblink_connect
|
dblink_connect
|
||||||
----------------
|
----------------
|
||||||
OK
|
OK
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT * FROM dblink('myconn', 'SELECT * FROM foo') AS t(a int, b text, c text[]);
|
SELECT * FROM dblink('myconn', 'SELECT * FROM foo') AS t(a int, b text, c text[]);
|
||||||
a | b | c
|
a | b | c
|
||||||
----+---+---------------
|
----+---+---------------
|
||||||
0 | a | {a0,b0,c0}
|
0 | a | {a0,b0,c0}
|
||||||
1 | b | {a1,b1,c1}
|
1 | b | {a1,b1,c1}
|
||||||
@@ -1397,7 +1397,7 @@ dblink_get_notify(text connname) returns setof (notify_name text, be_pid int, ex
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT dblink_exec('LISTEN virtual');
|
SELECT dblink_exec('LISTEN virtual');
|
||||||
dblink_exec
|
dblink_exec
|
||||||
-------------
|
-------------
|
||||||
LISTEN
|
LISTEN
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -2619,13 +2619,13 @@ CREATE POLICY admin_local_only ON passwd AS RESTRICTIVE TO admin
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
=> SELECT current_user;
|
=> SELECT current_user;
|
||||||
current_user
|
current_user
|
||||||
--------------
|
--------------
|
||||||
admin
|
admin
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
=> select inet_client_addr();
|
=> select inet_client_addr();
|
||||||
inet_client_addr
|
inet_client_addr
|
||||||
------------------
|
------------------
|
||||||
127.0.0.1
|
127.0.0.1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -1089,7 +1089,7 @@ ExecForeignTruncate(List *rels,
|
|||||||
requested in the original <command>TRUNCATE</command> command,
|
requested in the original <command>TRUNCATE</command> command,
|
||||||
respectively.
|
respectively.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If <literal>restart_seqs</literal> is <literal>true</literal>,
|
If <literal>restart_seqs</literal> is <literal>true</literal>,
|
||||||
the original <command>TRUNCATE</command> command requested the
|
the original <command>TRUNCATE</command> command requested the
|
||||||
|
@@ -6011,44 +6011,44 @@ regexp_replace('A PostgreSQL function', 'a|e|i|o|u', 'X', 1, 3, 'i')
|
|||||||
Some examples:
|
Some examples:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT foo FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', '\s+') AS foo;
|
SELECT foo FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', '\s+') AS foo;
|
||||||
foo
|
foo
|
||||||
-------
|
-------
|
||||||
the
|
the
|
||||||
quick
|
quick
|
||||||
brown
|
brown
|
||||||
fox
|
fox
|
||||||
jumps
|
jumps
|
||||||
over
|
over
|
||||||
the
|
the
|
||||||
lazy
|
lazy
|
||||||
dog
|
dog
|
||||||
(9 rows)
|
(9 rows)
|
||||||
|
|
||||||
SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', '\s+');
|
SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', '\s+');
|
||||||
regexp_split_to_array
|
regexp_split_to_array
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
{the,quick,brown,fox,jumps,over,the,lazy,dog}
|
{the,quick,brown,fox,jumps,over,the,lazy,dog}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT foo FROM regexp_split_to_table('the quick brown fox', '\s*') AS foo;
|
SELECT foo FROM regexp_split_to_table('the quick brown fox', '\s*') AS foo;
|
||||||
foo
|
foo
|
||||||
-----
|
-----
|
||||||
t
|
t
|
||||||
h
|
h
|
||||||
e
|
e
|
||||||
q
|
q
|
||||||
u
|
u
|
||||||
i
|
i
|
||||||
c
|
c
|
||||||
k
|
k
|
||||||
b
|
b
|
||||||
r
|
r
|
||||||
o
|
o
|
||||||
w
|
w
|
||||||
n
|
n
|
||||||
f
|
f
|
||||||
o
|
o
|
||||||
x
|
x
|
||||||
(16 rows)
|
(16 rows)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@@ -14400,32 +14400,32 @@ SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY VALUE '<towns><town>T
|
|||||||
<screen><![CDATA[
|
<screen><![CDATA[
|
||||||
SET xmloption TO DOCUMENT;
|
SET xmloption TO DOCUMENT;
|
||||||
SELECT xml_is_well_formed('<>');
|
SELECT xml_is_well_formed('<>');
|
||||||
xml_is_well_formed
|
xml_is_well_formed
|
||||||
--------------------
|
--------------------
|
||||||
f
|
f
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT xml_is_well_formed('<abc/>');
|
SELECT xml_is_well_formed('<abc/>');
|
||||||
xml_is_well_formed
|
xml_is_well_formed
|
||||||
--------------------
|
--------------------
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SET xmloption TO CONTENT;
|
SET xmloption TO CONTENT;
|
||||||
SELECT xml_is_well_formed('abc');
|
SELECT xml_is_well_formed('abc');
|
||||||
xml_is_well_formed
|
xml_is_well_formed
|
||||||
--------------------
|
--------------------
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT xml_is_well_formed_document('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
|
SELECT xml_is_well_formed_document('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
|
||||||
xml_is_well_formed_document
|
xml_is_well_formed_document
|
||||||
-----------------------------
|
-----------------------------
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT xml_is_well_formed_document('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
|
SELECT xml_is_well_formed_document('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
|
||||||
xml_is_well_formed_document
|
xml_is_well_formed_document
|
||||||
-----------------------------
|
-----------------------------
|
||||||
f
|
f
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -14492,7 +14492,7 @@ SELECT xml_is_well_formed_document('<pg:foo xmlns:pg="http://postgresql.org/stuf
|
|||||||
SELECT xpath('/my:a/text()', '<my:a xmlns:my="http://example.com">test</my:a>',
|
SELECT xpath('/my:a/text()', '<my:a xmlns:my="http://example.com">test</my:a>',
|
||||||
ARRAY[ARRAY['my', 'http://example.com']]);
|
ARRAY[ARRAY['my', 'http://example.com']]);
|
||||||
|
|
||||||
xpath
|
xpath
|
||||||
--------
|
--------
|
||||||
{test}
|
{test}
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -14540,7 +14540,7 @@ SELECT xpath('//mydefns:b/text()', '<a xmlns="http://example.com"><b>test</b></a
|
|||||||
SELECT xpath_exists('/my:a/text()', '<my:a xmlns:my="http://example.com">test</my:a>',
|
SELECT xpath_exists('/my:a/text()', '<my:a xmlns:my="http://example.com">test</my:a>',
|
||||||
ARRAY[ARRAY['my', 'http://example.com']]);
|
ARRAY[ARRAY['my', 'http://example.com']]);
|
||||||
|
|
||||||
xpath_exists
|
xpath_exists
|
||||||
--------------
|
--------------
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -14773,7 +14773,7 @@ SELECT xmltable.*
|
|||||||
'concat(SIZE[@unit!="sq_km"], " ", SIZE[@unit!="sq_km"]/@unit)',
|
'concat(SIZE[@unit!="sq_km"], " ", SIZE[@unit!="sq_km"]/@unit)',
|
||||||
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
|
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
|
||||||
|
|
||||||
id | ordinality | COUNTRY_NAME | country_id | size_sq_km | size_other | premier_name
|
id | ordinality | COUNTRY_NAME | country_id | size_sq_km | size_other | premier_name
|
||||||
----+------------+--------------+------------+------------+--------------+---------------
|
----+------------+--------------+------------+------------+--------------+---------------
|
||||||
1 | 1 | Australia | AU | | | not specified
|
1 | 1 | Australia | AU | | | not specified
|
||||||
5 | 2 | Japan | JP | | 145935 sq_mi | Shinzo Abe
|
5 | 2 | Japan | JP | | 145935 sq_mi | Shinzo Abe
|
||||||
@@ -14794,9 +14794,9 @@ $$ AS data;
|
|||||||
|
|
||||||
SELECT xmltable.*
|
SELECT xmltable.*
|
||||||
FROM xmlelements, XMLTABLE('/root' PASSING data COLUMNS element text);
|
FROM xmlelements, XMLTABLE('/root' PASSING data COLUMNS element text);
|
||||||
element
|
element
|
||||||
-------------------------
|
-------------------------
|
||||||
Hello2a2 bbbxxxCC
|
Hello2a2 bbbxxxCC
|
||||||
]]></screen>
|
]]></screen>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@@ -17769,14 +17769,14 @@ $.* ? (@ like_regex "^\\d+$")
|
|||||||
</para>
|
</para>
|
||||||
<screen>
|
<screen>
|
||||||
SELECT JSON('{ "a" : 123, "b": [ true, "foo" ], "a" : "bar" }');
|
SELECT JSON('{ "a" : 123, "b": [ true, "foo" ], "a" : "bar" }');
|
||||||
json
|
json
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
{ "a" : 123, "b": [ true, "foo" ], "a" : "bar" }
|
{ "a" : 123, "b": [ true, "foo" ], "a" : "bar" }
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
|
||||||
SELECT JSON('{"a": 123, "b": [true, "foo"], "a": "bar"}' RETURNING jsonb);
|
SELECT JSON('{"a": 123, "b": [true, "foo"], "a": "bar"}' RETURNING jsonb);
|
||||||
json
|
json
|
||||||
----------------------------------
|
----------------------------------
|
||||||
{"a": "bar", "b": [true, "foo"]}
|
{"a": "bar", "b": [true, "foo"]}
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -18097,7 +18097,7 @@ WHERE f.did = 103;
|
|||||||
<sect4 id="functions-jsonobjectagg">
|
<sect4 id="functions-jsonobjectagg">
|
||||||
<title><literal>JSON_OBJECTAGG</literal></title>
|
<title><literal>JSON_OBJECTAGG</literal></title>
|
||||||
<indexterm><primary>json_objectagg</primary></indexterm>
|
<indexterm><primary>json_objectagg</primary></indexterm>
|
||||||
|
|
||||||
<synopsis>
|
<synopsis>
|
||||||
<function>JSON_OBJECTAGG</function> (
|
<function>JSON_OBJECTAGG</function> (
|
||||||
<optional> { <parameter>key_expression</parameter> { VALUE | ':' } <parameter>value_expression</parameter> } </optional>
|
<optional> { <parameter>key_expression</parameter> { VALUE | ':' } <parameter>value_expression</parameter> } </optional>
|
||||||
@@ -18906,7 +18906,7 @@ SELECT JSON_VALUE('123.45', '$' RETURNING int ERROR ON ERROR);
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT JSON_VALUE('"03:04 2015-02-01"', '$.datetime("HH24:MI YYYY-MM-DD")' RETURNING date);
|
SELECT JSON_VALUE('"03:04 2015-02-01"', '$.datetime("HH24:MI YYYY-MM-DD")' RETURNING date);
|
||||||
json_value
|
json_value
|
||||||
------------
|
------------
|
||||||
2015-02-01
|
2015-02-01
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -19222,7 +19222,7 @@ SELECT JSON_QUERY(jsonb '"aaa"', '$' RETURNING text OMIT QUOTES);
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<literal>VALUE | SCALAR | ARRAY | OBJECT</literal>
|
<literal>VALUE | SCALAR | ARRAY | OBJECT</literal>
|
||||||
@@ -19875,7 +19875,7 @@ JSON_SERIALIZE (
|
|||||||
</para>
|
</para>
|
||||||
<screen>
|
<screen>
|
||||||
SELECT JSON_SERIALIZE(JSON_SCALAR('foo'));
|
SELECT JSON_SERIALIZE(JSON_SCALAR('foo'));
|
||||||
json_serialize
|
json_serialize
|
||||||
----------------
|
----------------
|
||||||
"foo"
|
"foo"
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -19890,7 +19890,7 @@ SELECT JSON_SERIALIZE('{"foo": "bar", "baz": [1, 2]}' RETURNING bytea);
|
|||||||
</sect4>
|
</sect4>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3 id="sqljson-common-clauses">
|
<sect3 id="sqljson-common-clauses">
|
||||||
<title>SQL/JSON Common Clauses</title>
|
<title>SQL/JSON Common Clauses</title>
|
||||||
|
|
||||||
@@ -28114,7 +28114,7 @@ SELECT collation for ('foo' COLLATE "de_DE");
|
|||||||
to log the memory contexts of a backend process. For example:
|
to log the memory contexts of a backend process. For example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
postgres=# SELECT pg_log_backend_memory_contexts(pg_backend_pid());
|
postgres=# SELECT pg_log_backend_memory_contexts(pg_backend_pid());
|
||||||
pg_log_backend_memory_contexts
|
pg_log_backend_memory_contexts
|
||||||
--------------------------------
|
--------------------------------
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -980,7 +980,7 @@ postgres=# SELECT * FROM pg_create_physical_replication_slot('node_a_slot');
|
|||||||
node_a_slot |
|
node_a_slot |
|
||||||
|
|
||||||
postgres=# SELECT slot_name, slot_type, active FROM pg_replication_slots;
|
postgres=# SELECT slot_name, slot_type, active FROM pg_replication_slots;
|
||||||
slot_name | slot_type | active
|
slot_name | slot_type | active
|
||||||
-------------+-----------+--------
|
-------------+-----------+--------
|
||||||
node_a_slot | physical | f
|
node_a_slot | physical | f
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -817,7 +817,7 @@ CREATE TABLE test (col1 integer, col2 text, col3 text);
|
|||||||
INSERT INTO test VALUES (123, 'foo', 'bar');
|
INSERT INTO test VALUES (123, 'foo', 'bar');
|
||||||
|
|
||||||
SELECT hstore(t) FROM test AS t;
|
SELECT hstore(t) FROM test AS t;
|
||||||
hstore
|
hstore
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
"col1"=>"123", "col2"=>"foo", "col3"=>"bar"
|
"col1"=>"123", "col2"=>"foo", "col3"=>"bar"
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -831,9 +831,9 @@ CREATE TABLE test (col1 integer, col2 text, col3 text);
|
|||||||
|
|
||||||
SELECT * FROM populate_record(null::test,
|
SELECT * FROM populate_record(null::test,
|
||||||
'"col1"=>"456", "col2"=>"zzz"');
|
'"col1"=>"456", "col2"=>"zzz"');
|
||||||
col1 | col2 | col3
|
col1 | col2 | col3
|
||||||
------+------+------
|
------+------+------
|
||||||
456 | zzz |
|
456 | zzz |
|
||||||
(1 row)
|
(1 row)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
@@ -845,7 +845,7 @@ CREATE TABLE test (col1 integer, col2 text, col3 text);
|
|||||||
INSERT INTO test VALUES (123, 'foo', 'bar');
|
INSERT INTO test VALUES (123, 'foo', 'bar');
|
||||||
|
|
||||||
SELECT (r).* FROM (SELECT t #= '"col3"=>"baz"' AS r FROM test t) s;
|
SELECT (r).* FROM (SELECT t #= '"col3"=>"baz"' AS r FROM test t) s;
|
||||||
col1 | col2 | col3
|
col1 | col2 | col3
|
||||||
------+------+------
|
------+------+------
|
||||||
123 | foo | baz
|
123 | foo | baz
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -200,13 +200,13 @@ SELECT '{"foo": [true, "bar"], "tags": {"a": 1, "b": null}}'::json;
|
|||||||
details such as whitespace. For example, note the differences here:
|
details such as whitespace. For example, note the differences here:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT '{"bar": "baz", "balance": 7.77, "active":false}'::json;
|
SELECT '{"bar": "baz", "balance": 7.77, "active":false}'::json;
|
||||||
json
|
json
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
{"bar": "baz", "balance": 7.77, "active":false}
|
{"bar": "baz", "balance": 7.77, "active":false}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT '{"bar": "baz", "balance": 7.77, "active":false}'::jsonb;
|
SELECT '{"bar": "baz", "balance": 7.77, "active":false}'::jsonb;
|
||||||
jsonb
|
jsonb
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
{"bar": "baz", "active": false, "balance": 7.77}
|
{"bar": "baz", "active": false, "balance": 7.77}
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -218,7 +218,7 @@ SELECT '{"bar": "baz", "balance": 7.77, "active":false}'::jsonb;
|
|||||||
example:
|
example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT '{"reading": 1.230e-5}'::json, '{"reading": 1.230e-5}'::jsonb;
|
SELECT '{"reading": 1.230e-5}'::json, '{"reading": 1.230e-5}'::jsonb;
|
||||||
json | jsonb
|
json | jsonb
|
||||||
-----------------------+-------------------------
|
-----------------------+-------------------------
|
||||||
{"reading": 1.230e-5} | {"reading": 0.00001230}
|
{"reading": 1.230e-5} | {"reading": 0.00001230}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -118,7 +118,7 @@
|
|||||||
any combination of <command>INSERT</command>, <command>UPDATE</command>,
|
any combination of <command>INSERT</command>, <command>UPDATE</command>,
|
||||||
<command>DELETE</command>, and <command>TRUNCATE</command>, similar to how triggers are fired by
|
<command>DELETE</command>, and <command>TRUNCATE</command>, similar to how triggers are fired by
|
||||||
particular event types. By default, all operation types are replicated.
|
particular event types. By default, all operation types are replicated.
|
||||||
(Row filters have no effect for <command>TRUNCATE</command>. See
|
(Row filters have no effect for <command>TRUNCATE</command>. See
|
||||||
<xref linkend="logical-replication-row-filter"/>).
|
<xref linkend="logical-replication-row-filter"/>).
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
By default, all data from all published tables will be replicated to the
|
By default, all data from all published tables will be replicated to the
|
||||||
appropriate subscribers. The replicated data can be reduced by using a
|
appropriate subscribers. The replicated data can be reduced by using a
|
||||||
<firstterm>row filter</firstterm>. A user might choose to use row filters
|
<firstterm>row filter</firstterm>. A user might choose to use row filters
|
||||||
for behavioral, security or performance reasons. If a published table sets a
|
for behavioral, security or performance reasons. If a published table sets a
|
||||||
row filter, a row is replicated only if its data satisfies the row filter
|
row filter, a row is replicated only if its data satisfies the row filter
|
||||||
@@ -533,14 +533,14 @@ CREATE PUBLICATION
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
test_pub=# \dRp+
|
test_pub=# \dRp+
|
||||||
Publication p1
|
Publication p1
|
||||||
Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root
|
Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root
|
||||||
----------+------------+---------+---------+---------+-----------+----------
|
----------+------------+---------+---------+---------+-----------+----------
|
||||||
postgres | f | t | t | t | t | f
|
postgres | f | t | t | t | t | f
|
||||||
Tables:
|
Tables:
|
||||||
"public.t1" WHERE ((a > 5) AND (c = 'NSW'::text))
|
"public.t1" WHERE ((a > 5) AND (c = 'NSW'::text))
|
||||||
|
|
||||||
Publication p2
|
Publication p2
|
||||||
Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root
|
Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root
|
||||||
----------+------------+---------+---------+---------+-----------+----------
|
----------+------------+---------+---------+---------+-----------+----------
|
||||||
postgres | f | t | t | t | t | f
|
postgres | f | t | t | t | t | f
|
||||||
Tables:
|
Tables:
|
||||||
@@ -548,7 +548,7 @@ Tables:
|
|||||||
"public.t2" WHERE (e = 99)
|
"public.t2" WHERE (e = 99)
|
||||||
|
|
||||||
Publication p3
|
Publication p3
|
||||||
Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root
|
Owner | All tables | Inserts | Updates | Deletes | Truncates | Via root
|
||||||
----------+------------+---------+---------+---------+-----------+----------
|
----------+------------+---------+---------+---------+-----------+----------
|
||||||
postgres | f | t | t | t | t | f
|
postgres | f | t | t | t | t | f
|
||||||
Tables:
|
Tables:
|
||||||
@@ -565,11 +565,11 @@ Tables:
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
test_pub=# \d t1
|
test_pub=# \d t1
|
||||||
Table "public.t1"
|
Table "public.t1"
|
||||||
Column | Type | Collation | Nullable | Default
|
Column | Type | Collation | Nullable | Default
|
||||||
--------+---------+-----------+----------+---------
|
--------+---------+-----------+----------+---------
|
||||||
a | integer | | not null |
|
a | integer | | not null |
|
||||||
b | integer | | |
|
b | integer | | |
|
||||||
c | text | | not null |
|
c | text | | not null |
|
||||||
Indexes:
|
Indexes:
|
||||||
"t1_pkey" PRIMARY KEY, btree (a, c)
|
"t1_pkey" PRIMARY KEY, btree (a, c)
|
||||||
Publications:
|
Publications:
|
||||||
@@ -578,11 +578,11 @@ Publications:
|
|||||||
|
|
||||||
test_pub=# \d t2
|
test_pub=# \d t2
|
||||||
Table "public.t2"
|
Table "public.t2"
|
||||||
Column | Type | Collation | Nullable | Default
|
Column | Type | Collation | Nullable | Default
|
||||||
--------+---------+-----------+----------+---------
|
--------+---------+-----------+----------+---------
|
||||||
d | integer | | not null |
|
d | integer | | not null |
|
||||||
e | integer | | |
|
e | integer | | |
|
||||||
f | integer | | |
|
f | integer | | |
|
||||||
Indexes:
|
Indexes:
|
||||||
"t2_pkey" PRIMARY KEY, btree (d)
|
"t2_pkey" PRIMARY KEY, btree (d)
|
||||||
Publications:
|
Publications:
|
||||||
@@ -591,11 +591,11 @@ Publications:
|
|||||||
|
|
||||||
test_pub=# \d t3
|
test_pub=# \d t3
|
||||||
Table "public.t3"
|
Table "public.t3"
|
||||||
Column | Type | Collation | Nullable | Default
|
Column | Type | Collation | Nullable | Default
|
||||||
--------+---------+-----------+----------+---------
|
--------+---------+-----------+----------+---------
|
||||||
g | integer | | not null |
|
g | integer | | not null |
|
||||||
h | integer | | |
|
h | integer | | |
|
||||||
i | integer | | |
|
i | integer | | |
|
||||||
Indexes:
|
Indexes:
|
||||||
"t3_pkey" PRIMARY KEY, btree (g)
|
"t3_pkey" PRIMARY KEY, btree (g)
|
||||||
Publications:
|
Publications:
|
||||||
@@ -636,7 +636,7 @@ INSERT 0 1
|
|||||||
test_pub=# INSERT INTO t1 VALUES (9, 109, 'NSW');
|
test_pub=# INSERT INTO t1 VALUES (9, 109, 'NSW');
|
||||||
INSERT 0 1
|
INSERT 0 1
|
||||||
|
|
||||||
test_pub=# SELECT * FROM t1;
|
test_pub=# SELECT * FROM t1;
|
||||||
a | b | c
|
a | b | c
|
||||||
---+-----+-----
|
---+-----+-----
|
||||||
2 | 102 | NSW
|
2 | 102 | NSW
|
||||||
@@ -651,7 +651,7 @@ test_pub=# SELECT * FROM t1;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test_sub=# SELECT * FROM t1;
|
test_sub=# SELECT * FROM t1;
|
||||||
a | b | c
|
a | b | c
|
||||||
---+-----+-----
|
---+-----+-----
|
||||||
6 | 106 | NSW
|
6 | 106 | NSW
|
||||||
9 | 109 | NSW
|
9 | 109 | NSW
|
||||||
@@ -668,7 +668,7 @@ test_pub=# UPDATE t1 SET b = 999 WHERE a = 6;
|
|||||||
UPDATE 1
|
UPDATE 1
|
||||||
|
|
||||||
test_pub=# SELECT * FROM t1;
|
test_pub=# SELECT * FROM t1;
|
||||||
a | b | c
|
a | b | c
|
||||||
---+-----+-----
|
---+-----+-----
|
||||||
2 | 102 | NSW
|
2 | 102 | NSW
|
||||||
3 | 103 | QLD
|
3 | 103 | QLD
|
||||||
@@ -682,7 +682,7 @@ test_pub=# SELECT * FROM t1;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test_sub=# SELECT * FROM t1;
|
test_sub=# SELECT * FROM t1;
|
||||||
a | b | c
|
a | b | c
|
||||||
---+-----+-----
|
---+-----+-----
|
||||||
9 | 109 | NSW
|
9 | 109 | NSW
|
||||||
6 | 999 | NSW
|
6 | 999 | NSW
|
||||||
@@ -700,7 +700,7 @@ test_pub=# UPDATE t1 SET a = 555 WHERE a = 2;
|
|||||||
UPDATE 1
|
UPDATE 1
|
||||||
|
|
||||||
test_pub=# SELECT * FROM t1;
|
test_pub=# SELECT * FROM t1;
|
||||||
a | b | c
|
a | b | c
|
||||||
-----+-----+-----
|
-----+-----+-----
|
||||||
3 | 103 | QLD
|
3 | 103 | QLD
|
||||||
4 | 104 | VIC
|
4 | 104 | VIC
|
||||||
@@ -714,7 +714,7 @@ test_pub=# SELECT * FROM t1;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test_sub=# SELECT * FROM t1;
|
test_sub=# SELECT * FROM t1;
|
||||||
a | b | c
|
a | b | c
|
||||||
-----+-----+-----
|
-----+-----+-----
|
||||||
9 | 109 | NSW
|
9 | 109 | NSW
|
||||||
6 | 999 | NSW
|
6 | 999 | NSW
|
||||||
@@ -733,7 +733,7 @@ test_pub=# UPDATE t1 SET c = 'VIC' WHERE a = 9;
|
|||||||
UPDATE 1
|
UPDATE 1
|
||||||
|
|
||||||
test_pub=# SELECT * FROM t1;
|
test_pub=# SELECT * FROM t1;
|
||||||
a | b | c
|
a | b | c
|
||||||
-----+-----+-----
|
-----+-----+-----
|
||||||
3 | 103 | QLD
|
3 | 103 | QLD
|
||||||
4 | 104 | VIC
|
4 | 104 | VIC
|
||||||
@@ -747,7 +747,7 @@ test_pub=# SELECT * FROM t1;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test_sub=# SELECT * FROM t1;
|
test_sub=# SELECT * FROM t1;
|
||||||
a | b | c
|
a | b | c
|
||||||
-----+-----+-----
|
-----+-----+-----
|
||||||
6 | 999 | NSW
|
6 | 999 | NSW
|
||||||
555 | 102 | NSW
|
555 | 102 | NSW
|
||||||
@@ -806,7 +806,7 @@ test_pub=# INSERT INTO child VALUES (3), (5), (7);
|
|||||||
INSERT 0 3
|
INSERT 0 3
|
||||||
|
|
||||||
test_pub=# SELECT * FROM parent ORDER BY a;
|
test_pub=# SELECT * FROM parent ORDER BY a;
|
||||||
a
|
a
|
||||||
---
|
---
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
@@ -818,7 +818,7 @@ test_pub=# SELECT * FROM parent ORDER BY a;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test_sub=# SELECT * FROM parent ORDER BY a;
|
test_sub=# SELECT * FROM parent ORDER BY a;
|
||||||
a
|
a
|
||||||
---
|
---
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
@@ -855,7 +855,7 @@ test_pub=# INSERT INTO child VALUES (3), (5), (7);
|
|||||||
INSERT 0 3
|
INSERT 0 3
|
||||||
|
|
||||||
test_pub=# SELECT * FROM parent ORDER BY a;
|
test_pub=# SELECT * FROM parent ORDER BY a;
|
||||||
a
|
a
|
||||||
---
|
---
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
@@ -867,7 +867,7 @@ test_pub=# SELECT * FROM parent ORDER BY a;
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test_sub=# SELECT * FROM child ORDER BY a;
|
test_sub=# SELECT * FROM child ORDER BY a;
|
||||||
a
|
a
|
||||||
---
|
---
|
||||||
5
|
5
|
||||||
6
|
6
|
||||||
|
@@ -69,7 +69,7 @@ postgres=# SELECT slot_name, plugin, slot_type, database, active, restart_lsn, c
|
|||||||
|
|
||||||
postgres=# -- There are no changes to see yet
|
postgres=# -- There are no changes to see yet
|
||||||
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----+-----+------
|
-----+-----+------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ CREATE TABLE
|
|||||||
|
|
||||||
postgres=# -- DDL isn't replicated, so all you'll see is the transaction
|
postgres=# -- DDL isn't replicated, so all you'll see is the transaction
|
||||||
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-------+--------------
|
-----------+-------+--------------
|
||||||
0/BA2DA58 | 10297 | BEGIN 10297
|
0/BA2DA58 | 10297 | BEGIN 10297
|
||||||
0/BA5A5A0 | 10297 | COMMIT 10297
|
0/BA5A5A0 | 10297 | COMMIT 10297
|
||||||
@@ -87,7 +87,7 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NU
|
|||||||
postgres=# -- Once changes are read, they're consumed and not emitted
|
postgres=# -- Once changes are read, they're consumed and not emitted
|
||||||
postgres=# -- in a subsequent call:
|
postgres=# -- in a subsequent call:
|
||||||
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----+-----+------
|
-----+-----+------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ postgres=*# INSERT INTO data(data) VALUES('2');
|
|||||||
postgres=*# COMMIT;
|
postgres=*# COMMIT;
|
||||||
|
|
||||||
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-------+---------------------------------------------------------
|
-----------+-------+---------------------------------------------------------
|
||||||
0/BA5A688 | 10298 | BEGIN 10298
|
0/BA5A688 | 10298 | BEGIN 10298
|
||||||
0/BA5A6F0 | 10298 | table public.data: INSERT: id[integer]:1 data[text]:'1'
|
0/BA5A6F0 | 10298 | table public.data: INSERT: id[integer]:1 data[text]:'1'
|
||||||
@@ -109,7 +109,7 @@ postgres=# INSERT INTO data(data) VALUES('3');
|
|||||||
|
|
||||||
postgres=# -- You can also peek ahead in the change stream without consuming changes
|
postgres=# -- You can also peek ahead in the change stream without consuming changes
|
||||||
postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL);
|
postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-------+---------------------------------------------------------
|
-----------+-------+---------------------------------------------------------
|
||||||
0/BA5A8E0 | 10299 | BEGIN 10299
|
0/BA5A8E0 | 10299 | BEGIN 10299
|
||||||
0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3'
|
0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3'
|
||||||
@@ -118,7 +118,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
|
|||||||
|
|
||||||
postgres=# -- The next call to pg_logical_slot_peek_changes() returns the same changes again
|
postgres=# -- The next call to pg_logical_slot_peek_changes() returns the same changes again
|
||||||
postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL);
|
postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-------+---------------------------------------------------------
|
-----------+-------+---------------------------------------------------------
|
||||||
0/BA5A8E0 | 10299 | BEGIN 10299
|
0/BA5A8E0 | 10299 | BEGIN 10299
|
||||||
0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3'
|
0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3'
|
||||||
@@ -127,7 +127,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
|
|||||||
|
|
||||||
postgres=# -- options can be passed to output plugin, to influence the formatting
|
postgres=# -- options can be passed to output plugin, to influence the formatting
|
||||||
postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-timestamp', 'on');
|
postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-timestamp', 'on');
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-------+---------------------------------------------------------
|
-----------+-------+---------------------------------------------------------
|
||||||
0/BA5A8E0 | 10299 | BEGIN 10299
|
0/BA5A8E0 | 10299 | BEGIN 10299
|
||||||
0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3'
|
0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3'
|
||||||
@@ -200,7 +200,7 @@ postgres=*# INSERT INTO data(data) VALUES('5');
|
|||||||
postgres=*# PREPARE TRANSACTION 'test_prepared1';
|
postgres=*# PREPARE TRANSACTION 'test_prepared1';
|
||||||
|
|
||||||
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-----+---------------------------------------------------------
|
-----------+-----+---------------------------------------------------------
|
||||||
0/1689DC0 | 529 | BEGIN 529
|
0/1689DC0 | 529 | BEGIN 529
|
||||||
0/1689DC0 | 529 | table public.data: INSERT: id[integer]:3 data[text]:'5'
|
0/1689DC0 | 529 | table public.data: INSERT: id[integer]:3 data[text]:'5'
|
||||||
@@ -209,7 +209,7 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NU
|
|||||||
|
|
||||||
postgres=# COMMIT PREPARED 'test_prepared1';
|
postgres=# COMMIT PREPARED 'test_prepared1';
|
||||||
postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-----+--------------------------------------------
|
-----------+-----+--------------------------------------------
|
||||||
0/168A060 | 529 | COMMIT PREPARED 'test_prepared1', txid 529
|
0/168A060 | 529 | COMMIT PREPARED 'test_prepared1', txid 529
|
||||||
(4 row)
|
(4 row)
|
||||||
@@ -219,7 +219,7 @@ postgres=# BEGIN;
|
|||||||
postgres=*# INSERT INTO data(data) VALUES('6');
|
postgres=*# INSERT INTO data(data) VALUES('6');
|
||||||
postgres=*# PREPARE TRANSACTION 'test_prepared2';
|
postgres=*# PREPARE TRANSACTION 'test_prepared2';
|
||||||
postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-----+---------------------------------------------------------
|
-----------+-----+---------------------------------------------------------
|
||||||
0/168A180 | 530 | BEGIN 530
|
0/168A180 | 530 | BEGIN 530
|
||||||
0/168A1E8 | 530 | table public.data: INSERT: id[integer]:4 data[text]:'6'
|
0/168A1E8 | 530 | table public.data: INSERT: id[integer]:4 data[text]:'6'
|
||||||
@@ -228,7 +228,7 @@ postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NU
|
|||||||
|
|
||||||
postgres=# ROLLBACK PREPARED 'test_prepared2';
|
postgres=# ROLLBACK PREPARED 'test_prepared2';
|
||||||
postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NULL);
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-----+----------------------------------------------
|
-----------+-----+----------------------------------------------
|
||||||
0/168A4B8 | 530 | ROLLBACK PREPARED 'test_prepared2', txid 530
|
0/168A4B8 | 530 | ROLLBACK PREPARED 'test_prepared2', txid 530
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -850,7 +850,7 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
|
|||||||
<parameter>gid</parameter> field, which is part of the
|
<parameter>gid</parameter> field, which is part of the
|
||||||
<parameter>txn</parameter> parameter, can be used in this callback to
|
<parameter>txn</parameter> parameter, can be used in this callback to
|
||||||
check if the plugin has already received this <command>PREPARE</command>
|
check if the plugin has already received this <command>PREPARE</command>
|
||||||
in which case it can either error out or skip the remaining changes of
|
in which case it can either error out or skip the remaining changes of
|
||||||
the transaction.
|
the transaction.
|
||||||
<programlisting>
|
<programlisting>
|
||||||
typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx,
|
typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx,
|
||||||
@@ -978,7 +978,7 @@ typedef void (*LogicalDecodeStreamCommitCB) (struct LogicalDecodingContext *ctx,
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3 id="logicaldecoding-output-plugin-stream-change">
|
<sect3 id="logicaldecoding-output-plugin-stream-change">
|
||||||
<title>Stream Change Callback</title>
|
<title>Stream Change Callback</title>
|
||||||
<para>
|
<para>
|
||||||
|
@@ -2302,7 +2302,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event is NOT NULL;
|
SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event is NOT NULL;
|
||||||
pid | wait_event_type | wait_event
|
pid | wait_event_type | wait_event
|
||||||
------+-----------------+------------
|
------+-----------------+------------
|
||||||
2540 | Lock | relation
|
2540 | Lock | relation
|
||||||
6644 | LWLock | ProcArray
|
6644 | LWLock | ProcArray
|
||||||
|
@@ -492,7 +492,7 @@ test=# SELECT itemoffset, ctid, itemlen, nulls, vars, data, dead, htid, tids[0:2
|
|||||||
not a valid <acronym>BRIN</acronym> page. For example:
|
not a valid <acronym>BRIN</acronym> page. For example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT brin_page_type(get_raw_page('brinidx', 0));
|
test=# SELECT brin_page_type(get_raw_page('brinidx', 0));
|
||||||
brin_page_type
|
brin_page_type
|
||||||
----------------
|
----------------
|
||||||
meta
|
meta
|
||||||
</screen>
|
</screen>
|
||||||
@@ -514,7 +514,7 @@ test=# SELECT brin_page_type(get_raw_page('brinidx', 0));
|
|||||||
about a <acronym>BRIN</acronym> index metapage. For example:
|
about a <acronym>BRIN</acronym> index metapage. For example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT * FROM brin_metapage_info(get_raw_page('brinidx', 0));
|
test=# SELECT * FROM brin_metapage_info(get_raw_page('brinidx', 0));
|
||||||
magic | version | pagesperrange | lastrevmappage
|
magic | version | pagesperrange | lastrevmappage
|
||||||
------------+---------+---------------+----------------
|
------------+---------+---------------+----------------
|
||||||
0xA8109CFA | 1 | 4 | 2
|
0xA8109CFA | 1 | 4 | 2
|
||||||
</screen>
|
</screen>
|
||||||
@@ -537,7 +537,7 @@ test=# SELECT * FROM brin_metapage_info(get_raw_page('brinidx', 0));
|
|||||||
For example:
|
For example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT * FROM brin_revmap_data(get_raw_page('brinidx', 2)) LIMIT 5;
|
test=# SELECT * FROM brin_revmap_data(get_raw_page('brinidx', 2)) LIMIT 5;
|
||||||
pages
|
pages
|
||||||
---------
|
---------
|
||||||
(6,137)
|
(6,137)
|
||||||
(6,138)
|
(6,138)
|
||||||
@@ -565,13 +565,13 @@ test=# SELECT * FROM brin_revmap_data(get_raw_page('brinidx', 2)) LIMIT 5;
|
|||||||
test=# SELECT * FROM brin_page_items(get_raw_page('brinidx', 5),
|
test=# SELECT * FROM brin_page_items(get_raw_page('brinidx', 5),
|
||||||
'brinidx')
|
'brinidx')
|
||||||
ORDER BY blknum, attnum LIMIT 6;
|
ORDER BY blknum, attnum LIMIT 6;
|
||||||
itemoffset | blknum | attnum | allnulls | hasnulls | placeholder | value
|
itemoffset | blknum | attnum | allnulls | hasnulls | placeholder | value
|
||||||
------------+--------+--------+----------+----------+-------------+--------------
|
------------+--------+--------+----------+----------+-------------+--------------
|
||||||
137 | 0 | 1 | t | f | f |
|
137 | 0 | 1 | t | f | f |
|
||||||
137 | 0 | 2 | f | f | f | {1 .. 88}
|
137 | 0 | 2 | f | f | f | {1 .. 88}
|
||||||
138 | 4 | 1 | t | f | f |
|
138 | 4 | 1 | t | f | f |
|
||||||
138 | 4 | 2 | f | f | f | {89 .. 176}
|
138 | 4 | 2 | f | f | f | {89 .. 176}
|
||||||
139 | 8 | 1 | t | f | f |
|
139 | 8 | 1 | t | f | f |
|
||||||
139 | 8 | 2 | f | f | f | {177 .. 264}
|
139 | 8 | 2 | f | f | f | {177 .. 264}
|
||||||
</screen>
|
</screen>
|
||||||
The returned columns correspond to the fields in the
|
The returned columns correspond to the fields in the
|
||||||
@@ -693,7 +693,7 @@ test=# SELECT first_tid, nbytes, tids[0:5] AS some_tids
|
|||||||
For example:
|
For example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT * FROM gist_page_opaque_info(get_raw_page('test_gist_idx', 2));
|
test=# SELECT * FROM gist_page_opaque_info(get_raw_page('test_gist_idx', 2));
|
||||||
lsn | nsn | rightlink | flags
|
lsn | nsn | rightlink | flags
|
||||||
-----+-----+-----------+--------
|
-----+-----+-----------+--------
|
||||||
0/1 | 0/0 | 1 | {leaf}
|
0/1 | 0/0 | 1 | {leaf}
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -716,7 +716,7 @@ test=# SELECT * FROM gist_page_opaque_info(get_raw_page('test_gist_idx', 2));
|
|||||||
the data stored in a page of a <acronym>GiST</acronym> index. For example:
|
the data stored in a page of a <acronym>GiST</acronym> index. For example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 0), 'test_gist_idx');
|
test=# SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 0), 'test_gist_idx');
|
||||||
itemoffset | ctid | itemlen | dead | keys
|
itemoffset | ctid | itemlen | dead | keys
|
||||||
------------+-----------+---------+------+-------------------
|
------------+-----------+---------+------+-------------------
|
||||||
1 | (1,65535) | 40 | f | (p)=((166,166))
|
1 | (1,65535) | 40 | f | (p)=((166,166))
|
||||||
2 | (2,65535) | 40 | f | (p)=((332,332))
|
2 | (2,65535) | 40 | f | (p)=((332,332))
|
||||||
@@ -747,7 +747,7 @@ test=# SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 0), 'test_gis
|
|||||||
example:
|
example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT * FROM gist_page_items_bytea(get_raw_page('test_gist_idx', 0));
|
test=# SELECT * FROM gist_page_items_bytea(get_raw_page('test_gist_idx', 0));
|
||||||
itemoffset | ctid | itemlen | dead | key_data
|
itemoffset | ctid | itemlen | dead | key_data
|
||||||
------------+-----------+---------+------+-----------------------------------------&zwsp;-------------------------------------------
|
------------+-----------+---------+------+-----------------------------------------&zwsp;-------------------------------------------
|
||||||
1 | (1,65535) | 40 | f | \x00000100ffff28000000000000c0644000000000&zwsp;00c06440000000000000f03f000000000000f03f
|
1 | (1,65535) | 40 | f | \x00000100ffff28000000000000c0644000000000&zwsp;00c06440000000000000f03f000000000000f03f
|
||||||
2 | (2,65535) | 40 | f | \x00000200ffff28000000000000c0744000000000&zwsp;00c074400000000000e064400000000000e06440
|
2 | (2,65535) | 40 | f | \x00000200ffff28000000000000c0744000000000&zwsp;00c074400000000000e064400000000000e06440
|
||||||
@@ -782,7 +782,7 @@ test=# SELECT * FROM gist_page_items_bytea(get_raw_page('test_gist_idx', 0));
|
|||||||
the given <acronym>HASH</acronym> index page. For example:
|
the given <acronym>HASH</acronym> index page. For example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT hash_page_type(get_raw_page('con_hash_index', 0));
|
test=# SELECT hash_page_type(get_raw_page('con_hash_index', 0));
|
||||||
hash_page_type
|
hash_page_type
|
||||||
----------------
|
----------------
|
||||||
metapage
|
metapage
|
||||||
</screen>
|
</screen>
|
||||||
@@ -835,7 +835,7 @@ hasho_page_id | 65408
|
|||||||
index page. For example:
|
index page. For example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT * FROM hash_page_items(get_raw_page('con_hash_index', 1)) LIMIT 5;
|
test=# SELECT * FROM hash_page_items(get_raw_page('con_hash_index', 1)) LIMIT 5;
|
||||||
itemoffset | ctid | data
|
itemoffset | ctid | data
|
||||||
------------+-----------+------------
|
------------+-----------+------------
|
||||||
1 | (899,77) | 1053474816
|
1 | (899,77) | 1053474816
|
||||||
2 | (897,29) | 1053474816
|
2 | (897,29) | 1053474816
|
||||||
@@ -862,7 +862,7 @@ test=# SELECT * FROM hash_page_items(get_raw_page('con_hash_index', 1)) LIMIT 5;
|
|||||||
index. For example:
|
index. For example:
|
||||||
<screen>
|
<screen>
|
||||||
test=# SELECT * FROM hash_bitmap_info('con_hash_index', 2052);
|
test=# SELECT * FROM hash_bitmap_info('con_hash_index', 2052);
|
||||||
bitmapblkno | bitmapbit | bitstatus
|
bitmapblkno | bitmapbit | bitstatus
|
||||||
-------------+-----------+-----------
|
-------------+-----------+-----------
|
||||||
65 | 3 | t
|
65 | 3 | t
|
||||||
</screen>
|
</screen>
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
|
EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%';
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;------------------
|
-------------------------------------------------------------------&zwsp;------------------
|
||||||
Gather (cost=1000.00..217018.43 rows=1 width=97)
|
Gather (cost=1000.00..217018.43 rows=1 width=97)
|
||||||
Workers Planned: 2
|
Workers Planned: 2
|
||||||
|
@@ -1221,7 +1221,7 @@ ANALYZE zipcodes;
|
|||||||
SELECT stxname, stxkeys, stxddependencies
|
SELECT stxname, stxkeys, stxddependencies
|
||||||
FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid)
|
FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid)
|
||||||
WHERE stxname = 'stts';
|
WHERE stxname = 'stts';
|
||||||
stxname | stxkeys | stxddependencies
|
stxname | stxkeys | stxddependencies
|
||||||
---------+---------+------------------------------------------
|
---------+---------+------------------------------------------
|
||||||
stts | 1 5 | {"1 => 5": 1.000000, "5 => 1": 0.423130}
|
stts | 1 5 | {"1 => 5": 1.000000, "5 => 1": 0.423130}
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -1367,7 +1367,7 @@ ANALYZE zipcodes;
|
|||||||
SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid),
|
SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid),
|
||||||
pg_mcv_list_items(stxdmcv) m WHERE stxname = 'stts3';
|
pg_mcv_list_items(stxdmcv) m WHERE stxname = 'stts3';
|
||||||
|
|
||||||
index | values | nulls | frequency | base_frequency
|
index | values | nulls | frequency | base_frequency
|
||||||
-------+------------------------+-------+-----------+----------------
|
-------+------------------------+-------+-----------+----------------
|
||||||
0 | {Washington, DC} | {f,f} | 0.003467 | 2.7e-05
|
0 | {Washington, DC} | {f,f} | 0.003467 | 2.7e-05
|
||||||
1 | {Apo, AE} | {f,f} | 0.003067 | 1.9e-05
|
1 | {Apo, AE} | {f,f} | 0.003067 | 1.9e-05
|
||||||
|
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
postgres=# SELECT * FROM pg_freespace('foo');
|
postgres=# SELECT * FROM pg_freespace('foo');
|
||||||
blkno | avail
|
blkno | avail
|
||||||
-------+-------
|
-------+-------
|
||||||
0 | 0
|
0 | 0
|
||||||
1 | 0
|
1 | 0
|
||||||
@@ -101,7 +101,7 @@ postgres=# SELECT * FROM pg_freespace('foo');
|
|||||||
(20 rows)
|
(20 rows)
|
||||||
|
|
||||||
postgres=# SELECT * FROM pg_freespace('foo', 7);
|
postgres=# SELECT * FROM pg_freespace('foo', 7);
|
||||||
pg_freespace
|
pg_freespace
|
||||||
--------------
|
--------------
|
||||||
1216
|
1216
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -948,7 +948,7 @@ query | SELECT pg_stat_statements_reset(0,0,0)
|
|||||||
calls | 1
|
calls | 1
|
||||||
total_exec_time | 0.189497
|
total_exec_time | 0.189497
|
||||||
rows | 1
|
rows | 1
|
||||||
hit_percent |
|
hit_percent |
|
||||||
-[ RECORD 2 ]---+--------------------------------------------------&zwsp;---------------------------
|
-[ RECORD 2 ]---+--------------------------------------------------&zwsp;---------------------------
|
||||||
query | SELECT query, calls, total_exec_time, rows, $1 * shared_blks_hit / +
|
query | SELECT query, calls, total_exec_time, rows, $1 * shared_blks_hit / +
|
||||||
| nullif(shared_blks_hit + shared_blks_read, $2) AS hit_percent+
|
| nullif(shared_blks_hit + shared_blks_read, $2) AS hit_percent+
|
||||||
@@ -956,7 +956,7 @@ query | SELECT query, calls, total_exec_time, rows, $1 * shared_blks_h
|
|||||||
calls | 0
|
calls | 0
|
||||||
total_exec_time | 0
|
total_exec_time | 0
|
||||||
rows | 0
|
rows | 0
|
||||||
hit_percent |
|
hit_percent |
|
||||||
|
|
||||||
</screen>
|
</screen>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
@@ -39,9 +39,9 @@ ERROR: could not access status of transaction 4007513275
|
|||||||
DETAIL: Could not open file "pg_xact/0EED": No such file or directory.
|
DETAIL: Could not open file "pg_xact/0EED": No such file or directory.
|
||||||
|
|
||||||
test=# select heap_force_kill('t1'::regclass, ARRAY['(0, 1)']::tid[]);
|
test=# select heap_force_kill('t1'::regclass, ARRAY['(0, 1)']::tid[]);
|
||||||
heap_force_kill
|
heap_force_kill
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
test=# select * from t1 where ctid = '(0, 1)';
|
test=# select * from t1 where ctid = '(0, 1)';
|
||||||
@@ -71,15 +71,15 @@ ERROR: found xmin 507 from before relfrozenxid 515
|
|||||||
CONTEXT: while scanning block 0 of relation "public.t1"
|
CONTEXT: while scanning block 0 of relation "public.t1"
|
||||||
|
|
||||||
test=# select ctid from t1 where xmin = 507;
|
test=# select ctid from t1 where xmin = 507;
|
||||||
ctid
|
ctid
|
||||||
-------
|
-------
|
||||||
(0,3)
|
(0,3)
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
test=# select heap_force_freeze('t1'::regclass, ARRAY['(0, 3)']::tid[]);
|
test=# select heap_force_freeze('t1'::regclass, ARRAY['(0, 3)']::tid[]);
|
||||||
heap_force_freeze
|
heap_force_freeze
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
test=# select ctid from t1 where xmin = 2;
|
test=# select ctid from t1 where xmin = 2;
|
||||||
|
@@ -108,7 +108,7 @@
|
|||||||
follows:
|
follows:
|
||||||
<screen>
|
<screen>
|
||||||
postgres=# select start_lsn, end_lsn, prev_lsn, xid, resource_manager, record_type, record_length, main_data_length, fpi_length, description from pg_get_wal_records_info('0/14F9A30', '0/15011D7');
|
postgres=# select start_lsn, end_lsn, prev_lsn, xid, resource_manager, record_type, record_length, main_data_length, fpi_length, description from pg_get_wal_records_info('0/14F9A30', '0/15011D7');
|
||||||
start_lsn | end_lsn | prev_lsn | xid | resource_manager | record_type | record_length | main_data_length | fpi_length | description
|
start_lsn | end_lsn | prev_lsn | xid | resource_manager | record_type | record_length | main_data_length | fpi_length | description
|
||||||
-----------+-----------+-----------+-----+------------------+--------------+---------------+------------------+------------+---------------------
|
-----------+-----------+-----------+-----+------------------+--------------+---------------+------------------+------------+---------------------
|
||||||
0/14FA118 | 0/14FB4B0 | 0/14F9958 | 725 | Btree | INSERT_LEAF | 5013 | 2 | 4960 | off 246
|
0/14FA118 | 0/14FB4B0 | 0/14F9958 | 725 | Btree | INSERT_LEAF | 5013 | 2 | 4960 | off 246
|
||||||
0/14FB4B0 | 0/14FD050 | 0/14FA118 | 725 | Btree | INSERT_LEAF | 7045 | 2 | 6992 | off 130
|
0/14FB4B0 | 0/14FD050 | 0/14FA118 | 725 | Btree | INSERT_LEAF | 7045 | 2 | 6992 | off 130
|
||||||
@@ -189,7 +189,7 @@ postgres=# select start_lsn, end_lsn, prev_lsn, xid, resource_manager, record_ty
|
|||||||
follows:
|
follows:
|
||||||
<screen>
|
<screen>
|
||||||
postgres=# select * from pg_get_wal_stats('0/12FBA30', '0/15011D7') where count > 0;
|
postgres=# select * from pg_get_wal_stats('0/12FBA30', '0/15011D7') where count > 0;
|
||||||
resource_manager/record_type | count | count_percentage | record_size | record_size_percentage | fpi_size | fpi_size_percentage | combined_size | combined_size_percentage
|
resource_manager/record_type | count | count_percentage | record_size | record_size_percentage | fpi_size | fpi_size_percentage | combined_size | combined_size_percentage
|
||||||
------------------------------+-------+------------------+-------------+------------------------+----------+---------------------+---------------+--------------------------
|
------------------------------+-------+------------------+-------------+------------------------+----------+---------------------+---------------+--------------------------
|
||||||
XLOG | 10 | 0.10871929 | 796 | 0.052369177 | 352 | 0.061031006 | 1148 | 0.054751817
|
XLOG | 10 | 0.10871929 | 796 | 0.052369177 | 352 | 0.061031006 | 1148 | 0.054751817
|
||||||
Transaction | 187 | 2.0330508 | 62773 | 4.1298623 | 0 | 0 | 62773 | 2.9938467
|
Transaction | 187 | 2.0330508 | 62773 | 4.1298623 | 0 | 0 | 62773 | 2.9938467
|
||||||
@@ -206,7 +206,7 @@ With <replaceable>per_record</replaceable> passed as <literal>true</literal>:
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
postgres=# select * from pg_get_wal_stats('0/14AFC30', '0/15011D7', true) where count > 0;
|
postgres=# select * from pg_get_wal_stats('0/14AFC30', '0/15011D7', true) where count > 0;
|
||||||
resource_manager/record_type | count | count_percentage | record_size | record_size_percentage | fpi_size | fpi_size_percentage | combined_size | combined_size_percentage
|
resource_manager/record_type | count | count_percentage | record_size | record_size_percentage | fpi_size | fpi_size_percentage | combined_size | combined_size_percentage
|
||||||
------------------------------+-------+------------------+-------------+------------------------+----------+---------------------+---------------+--------------------------
|
------------------------------+-------+------------------+-------------+------------------------+----------+---------------------+---------------+--------------------------
|
||||||
XLOG/CHECKPOINT_SHUTDOWN | 1 | 0.32894737 | 114 | 0.22891566 | 0 | 0 | 114 | 0.03534489
|
XLOG/CHECKPOINT_SHUTDOWN | 1 | 0.32894737 | 114 | 0.22891566 | 0 | 0 | 114 | 0.03534489
|
||||||
XLOG/CHECKPOINT_ONLINE | 4 | 1.3157895 | 456 | 0.91566265 | 0 | 0 | 456 | 0.14137957
|
XLOG/CHECKPOINT_ONLINE | 4 | 1.3157895 | 456 | 0.91566265 | 0 | 0 | 456 | 0.14137957
|
||||||
|
@@ -490,7 +490,7 @@ SELECT relpages, reltuples FROM pg_class WHERE relname = 't';
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1;
|
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;------------
|
-------------------------------------------------------------------&zwsp;------------
|
||||||
Seq Scan on t (cost=0.00..170.00 rows=100 width=8) (actual rows=100 loops=1)
|
Seq Scan on t (cost=0.00..170.00 rows=100 width=8) (actual rows=100 loops=1)
|
||||||
Filter: (a = 1)
|
Filter: (a = 1)
|
||||||
@@ -507,7 +507,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1;
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;----------
|
-------------------------------------------------------------------&zwsp;----------
|
||||||
Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=100 loops=1)
|
Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=100 loops=1)
|
||||||
Filter: ((a = 1) AND (b = 1))
|
Filter: ((a = 1) AND (b = 1))
|
||||||
@@ -531,7 +531,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
|||||||
CREATE STATISTICS stts (dependencies) ON a, b FROM t;
|
CREATE STATISTICS stts (dependencies) ON a, b FROM t;
|
||||||
ANALYZE t;
|
ANALYZE t;
|
||||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;------------
|
-------------------------------------------------------------------&zwsp;------------
|
||||||
Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1)
|
Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1)
|
||||||
Filter: ((a = 1) AND (b = 1))
|
Filter: ((a = 1) AND (b = 1))
|
||||||
@@ -552,7 +552,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
|||||||
accurate:
|
accurate:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a;
|
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;----------------------
|
-------------------------------------------------------------------&zwsp;----------------------
|
||||||
HashAggregate (cost=195.00..196.00 rows=100 width=12) (actual rows=100 loops=1)
|
HashAggregate (cost=195.00..196.00 rows=100 width=12) (actual rows=100 loops=1)
|
||||||
Group Key: a
|
Group Key: a
|
||||||
@@ -563,7 +563,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a;
|
|||||||
in the following example, is off by an order of magnitude:
|
in the following example, is off by an order of magnitude:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b;
|
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;-------------------------
|
-------------------------------------------------------------------&zwsp;-------------------------
|
||||||
HashAggregate (cost=220.00..230.00 rows=1000 width=16) (actual rows=100 loops=1)
|
HashAggregate (cost=220.00..230.00 rows=1000 width=16) (actual rows=100 loops=1)
|
||||||
Group Key: a, b
|
Group Key: a, b
|
||||||
@@ -576,7 +576,7 @@ DROP STATISTICS stts;
|
|||||||
CREATE STATISTICS stts (dependencies, ndistinct) ON a, b FROM t;
|
CREATE STATISTICS stts (dependencies, ndistinct) ON a, b FROM t;
|
||||||
ANALYZE t;
|
ANALYZE t;
|
||||||
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b;
|
EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b;
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;-------------------------
|
-------------------------------------------------------------------&zwsp;-------------------------
|
||||||
HashAggregate (cost=220.00..221.00 rows=100 width=16) (actual rows=100 loops=1)
|
HashAggregate (cost=220.00..221.00 rows=100 width=16) (actual rows=100 loops=1)
|
||||||
Group Key: a, b
|
Group Key: a, b
|
||||||
@@ -637,7 +637,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1;
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid),
|
SELECT m.* FROM pg_statistic_ext join pg_statistic_ext_data on (oid = stxoid),
|
||||||
pg_mcv_list_items(stxdmcv) m WHERE stxname = 'stts2';
|
pg_mcv_list_items(stxdmcv) m WHERE stxname = 'stts2';
|
||||||
index | values | nulls | frequency | base_frequency
|
index | values | nulls | frequency | base_frequency
|
||||||
-------+----------+-------+-----------+----------------
|
-------+----------+-------+-----------+----------------
|
||||||
0 | {0, 0} | {f,f} | 0.01 | 0.0001
|
0 | {0, 0} | {f,f} | 0.01 | 0.0001
|
||||||
1 | {1, 1} | {f,f} | 0.01 | 0.0001
|
1 | {1, 1} | {f,f} | 0.01 | 0.0001
|
||||||
|
@@ -709,7 +709,7 @@ SELECT init_hosts_query();
|
|||||||
SELECT query_hosts('192.168.1.0/30');
|
SELECT query_hosts('192.168.1.0/30');
|
||||||
SELECT release_hosts_query();
|
SELECT release_hosts_query();
|
||||||
|
|
||||||
query_hosts
|
query_hosts
|
||||||
-----------------
|
-----------------
|
||||||
(1,192.168.1.1)
|
(1,192.168.1.1)
|
||||||
(2,192.168.1.2)
|
(2,192.168.1.2)
|
||||||
|
@@ -5352,9 +5352,9 @@ WARNING: number of source and target fields in assignment does not match
|
|||||||
DETAIL: strict_multi_assignment check of extra_warnings is active.
|
DETAIL: strict_multi_assignment check of extra_warnings is active.
|
||||||
HINT: Make sure the query returns the exact list of columns.
|
HINT: Make sure the query returns the exact list of columns.
|
||||||
|
|
||||||
foo
|
foo
|
||||||
-----
|
-----
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
@@ -729,7 +729,7 @@ OPTIONS (ADD password_required 'false');
|
|||||||
Example usage of the function:
|
Example usage of the function:
|
||||||
<screen>
|
<screen>
|
||||||
postgres=# SELECT * FROM postgres_fdw_get_connections() ORDER BY 1;
|
postgres=# SELECT * FROM postgres_fdw_get_connections() ORDER BY 1;
|
||||||
server_name | valid
|
server_name | valid
|
||||||
-------------+-------
|
-------------+-------
|
||||||
loopback1 | t
|
loopback1 | t
|
||||||
loopback2 | f
|
loopback2 | f
|
||||||
@@ -754,7 +754,7 @@ postgres=# SELECT * FROM postgres_fdw_get_connections() ORDER BY 1;
|
|||||||
Example usage of the function:
|
Example usage of the function:
|
||||||
<screen>
|
<screen>
|
||||||
postgres=# SELECT postgres_fdw_disconnect('loopback1');
|
postgres=# SELECT postgres_fdw_disconnect('loopback1');
|
||||||
postgres_fdw_disconnect
|
postgres_fdw_disconnect
|
||||||
-------------------------
|
-------------------------
|
||||||
t
|
t
|
||||||
</screen>
|
</screen>
|
||||||
@@ -775,7 +775,7 @@ postgres=# SELECT postgres_fdw_disconnect('loopback1');
|
|||||||
Example usage of the function:
|
Example usage of the function:
|
||||||
<screen>
|
<screen>
|
||||||
postgres=# SELECT postgres_fdw_disconnect_all();
|
postgres=# SELECT postgres_fdw_disconnect_all();
|
||||||
postgres_fdw_disconnect_all
|
postgres_fdw_disconnect_all
|
||||||
-----------------------------
|
-----------------------------
|
||||||
t
|
t
|
||||||
</screen>
|
</screen>
|
||||||
|
@@ -649,9 +649,9 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
postgres=# \d tab
|
postgres=# \d tab
|
||||||
Table "public.tab"
|
Table "public.tab"
|
||||||
Column | Type | Collation | Nullable | Default
|
Column | Type | Collation | Nullable | Default
|
||||||
--------+---------+-----------+----------+---------
|
--------+---------+-----------+----------+---------
|
||||||
col | integer | | |
|
col | integer | | |
|
||||||
Indexes:
|
Indexes:
|
||||||
"idx" btree (col) INVALID
|
"idx" btree (col) INVALID
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@@ -395,7 +395,7 @@ EXPLAIN (FORMAT YAML) SELECT * FROM foo WHERE i='4';
|
|||||||
Total Cost: 5.98 +
|
Total Cost: 5.98 +
|
||||||
Plan Rows: 1 +
|
Plan Rows: 1 +
|
||||||
Plan Width: 4 +
|
Plan Width: 4 +
|
||||||
Index Cond: "(i = 4)"
|
Index Cond: "(i = 4)"
|
||||||
(1 row)
|
(1 row)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
@@ -442,7 +442,7 @@ PREPARE query(int, int) AS SELECT sum(bar) FROM test
|
|||||||
|
|
||||||
EXPLAIN ANALYZE EXECUTE query(100, 200);
|
EXPLAIN ANALYZE EXECUTE query(100, 200);
|
||||||
|
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-------------------------------------------------------------------&zwsp;-----------------------------------------------------
|
-------------------------------------------------------------------&zwsp;-----------------------------------------------------
|
||||||
HashAggregate (cost=9.54..9.54 rows=1 width=8) (actual time=0.156..0.161 rows=11 loops=1)
|
HashAggregate (cost=9.54..9.54 rows=1 width=8) (actual time=0.156..0.161 rows=11 loops=1)
|
||||||
Group Key: foo
|
Group Key: foo
|
||||||
|
@@ -160,8 +160,7 @@ pg_archivecleanup: removing file "archive/00000001000000370000000E"
|
|||||||
<literal>never</literal>.
|
<literal>never</literal>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
|
@@ -116,7 +116,7 @@ PostgreSQL documentation
|
|||||||
<literal>never</literal>.
|
<literal>never</literal>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See Also</title>
|
<title>See Also</title>
|
||||||
|
|
||||||
|
@@ -4992,7 +4992,7 @@ testdb=> <userinput>\d my_table</userinput>
|
|||||||
Column | Type | Collation | Nullable | Default
|
Column | Type | Collation | Nullable | Default
|
||||||
--------+---------+-----------+----------+---------
|
--------+---------+-----------+----------+---------
|
||||||
first | integer | | not null | 0
|
first | integer | | not null | 0
|
||||||
second | text | | |
|
second | text | | |
|
||||||
</programlisting>
|
</programlisting>
|
||||||
Now we change the prompt to something more interesting:
|
Now we change the prompt to something more interesting:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -5123,7 +5123,7 @@ testdb=> <userinput>\df int*pl * bigint</userinput>
|
|||||||
with the <command>\crosstabview</command> command:
|
with the <command>\crosstabview</command> command:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
testdb=> <userinput>SELECT first, second, first > 2 AS gt2 FROM my_table;</userinput>
|
testdb=> <userinput>SELECT first, second, first > 2 AS gt2 FROM my_table;</userinput>
|
||||||
first | second | gt2
|
first | second | gt2
|
||||||
-------+--------+-----
|
-------+--------+-----
|
||||||
1 | one | f
|
1 | one | f
|
||||||
2 | two | f
|
2 | two | f
|
||||||
@@ -5132,11 +5132,11 @@ testdb=> <userinput>SELECT first, second, first > 2 AS gt2 FROM my_table;<
|
|||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
testdb=> <userinput>\crosstabview first second</userinput>
|
testdb=> <userinput>\crosstabview first second</userinput>
|
||||||
first | one | two | three | four
|
first | one | two | three | four
|
||||||
-------+-----+-----+-------+------
|
-------+-----+-----+-------+------
|
||||||
1 | f | | |
|
1 | f | | |
|
||||||
2 | | f | |
|
2 | | f | |
|
||||||
3 | | | t |
|
3 | | | t |
|
||||||
4 | | | | t
|
4 | | | | t
|
||||||
(4 rows)
|
(4 rows)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -5148,7 +5148,7 @@ testdb=> <userinput>SELECT t1.first as "A", t2.first+100 AS "B", t1.first*(t2
|
|||||||
testdb(> <userinput>row_number() over(order by t2.first) AS ord</userinput>
|
testdb(> <userinput>row_number() over(order by t2.first) AS ord</userinput>
|
||||||
testdb(> <userinput>FROM my_table t1 CROSS JOIN my_table t2 ORDER BY 1 DESC</userinput>
|
testdb(> <userinput>FROM my_table t1 CROSS JOIN my_table t2 ORDER BY 1 DESC</userinput>
|
||||||
testdb(> <userinput>\crosstabview "A" "B" "AxB" ord</userinput>
|
testdb(> <userinput>\crosstabview "A" "B" "AxB" ord</userinput>
|
||||||
A | 101 | 102 | 103 | 104
|
A | 101 | 102 | 103 | 104
|
||||||
---+-----+-----+-----+-----
|
---+-----+-----+-----+-----
|
||||||
4 | 404 | 408 | 412 | 416
|
4 | 404 | 408 | 412 | 416
|
||||||
3 | 303 | 306 | 309 | 312
|
3 | 303 | 306 | 309 | 312
|
||||||
|
@@ -309,7 +309,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
|
|||||||
reindexed in a separate transaction. Those commands cannot be used inside
|
reindexed in a separate transaction. Those commands cannot be used inside
|
||||||
a transaction block when working on a partitioned table or index.
|
a transaction block when working on a partitioned table or index.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
When using the <literal>TABLESPACE</literal> clause with
|
When using the <literal>TABLESPACE</literal> clause with
|
||||||
<command>REINDEX</command> on a partitioned index or table, only the
|
<command>REINDEX</command> on a partitioned index or table, only the
|
||||||
@@ -329,7 +329,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
|
|||||||
will be generated. Indexes on TOAST tables are rebuilt, but not moved
|
will be generated. Indexes on TOAST tables are rebuilt, but not moved
|
||||||
to the new tablespace.
|
to the new tablespace.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<refsect2 id="sql-reindex-concurrently" xreflabel="Rebuilding Indexes Concurrently">
|
<refsect2 id="sql-reindex-concurrently" xreflabel="Rebuilding Indexes Concurrently">
|
||||||
<title>Rebuilding Indexes Concurrently</title>
|
<title>Rebuilding Indexes Concurrently</title>
|
||||||
|
|
||||||
|
@@ -112,14 +112,14 @@ DECLARE foo CURSOR FOR SELECT 1 UNION SELECT 2;
|
|||||||
SAVEPOINT foo;
|
SAVEPOINT foo;
|
||||||
|
|
||||||
FETCH 1 FROM foo;
|
FETCH 1 FROM foo;
|
||||||
?column?
|
?column?
|
||||||
----------
|
----------
|
||||||
1
|
1
|
||||||
|
|
||||||
ROLLBACK TO SAVEPOINT foo;
|
ROLLBACK TO SAVEPOINT foo;
|
||||||
|
|
||||||
FETCH 1 FROM foo;
|
FETCH 1 FROM foo;
|
||||||
?column?
|
?column?
|
||||||
----------
|
----------
|
||||||
2
|
2
|
||||||
|
|
||||||
|
@@ -1915,7 +1915,7 @@ SELECT * FROM t
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT * FROM t
|
SELECT * FROM t
|
||||||
|
|
||||||
x
|
x
|
||||||
--------------------
|
--------------------
|
||||||
0.534150459803641
|
0.534150459803641
|
||||||
0.520092216785997
|
0.520092216785997
|
||||||
|
@@ -115,7 +115,7 @@ RESET ROLE
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT SESSION_USER, CURRENT_USER;
|
SELECT SESSION_USER, CURRENT_USER;
|
||||||
|
|
||||||
session_user | current_user
|
session_user | current_user
|
||||||
--------------+--------------
|
--------------+--------------
|
||||||
peter | peter
|
peter | peter
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ SET ROLE 'paul';
|
|||||||
|
|
||||||
SELECT SESSION_USER, CURRENT_USER;
|
SELECT SESSION_USER, CURRENT_USER;
|
||||||
|
|
||||||
session_user | current_user
|
session_user | current_user
|
||||||
--------------+--------------
|
--------------+--------------
|
||||||
peter | paul
|
peter | paul
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@@ -84,7 +84,7 @@ RESET SESSION AUTHORIZATION
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT SESSION_USER, CURRENT_USER;
|
SELECT SESSION_USER, CURRENT_USER;
|
||||||
|
|
||||||
session_user | current_user
|
session_user | current_user
|
||||||
--------------+--------------
|
--------------+--------------
|
||||||
peter | peter
|
peter | peter
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ SET SESSION AUTHORIZATION 'paul';
|
|||||||
|
|
||||||
SELECT SESSION_USER, CURRENT_USER;
|
SELECT SESSION_USER, CURRENT_USER;
|
||||||
|
|
||||||
session_user | current_user
|
session_user | current_user
|
||||||
--------------+--------------
|
--------------+--------------
|
||||||
paul | paul
|
paul | paul
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@@ -167,7 +167,7 @@ SHOW geqo;
|
|||||||
Show all settings:
|
Show all settings:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SHOW ALL;
|
SHOW ALL;
|
||||||
name | setting | description
|
name | setting | description
|
||||||
-------------------------+---------+-------------------------------------------------
|
-------------------------+---------+-------------------------------------------------
|
||||||
allow_system_table_mods | off | Allows modifications of the structure of ...
|
allow_system_table_mods | off | Allows modifications of the structure of ...
|
||||||
.
|
.
|
||||||
|
@@ -8,9 +8,9 @@
|
|||||||
<title>Release date:</title>
|
<title>Release date:</title>
|
||||||
<para>2022-??-??</para>
|
<para>2022-??-??</para>
|
||||||
</formalpara>
|
</formalpara>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This is just a placeholder for now.
|
This is just a placeholder for now.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
@@ -1010,7 +1010,7 @@ VACUUM ANALYZE wrd;
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT count(*) FROM words WHERE word = 'caterpiler';
|
SELECT count(*) FROM words WHERE word = 'caterpiler';
|
||||||
|
|
||||||
count
|
count
|
||||||
-------
|
-------
|
||||||
0
|
0
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -1047,7 +1047,7 @@ SELECT count(*) FROM words WHERE word = 'caterpiler';
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10;
|
SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10;
|
||||||
|
|
||||||
word
|
word
|
||||||
---------------
|
---------------
|
||||||
cater
|
cater
|
||||||
caterpillar
|
caterpillar
|
||||||
@@ -1337,7 +1337,7 @@ UPDATE shoelace_data SET sl_avail = 6 WHERE sl_name = 'sl7';
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT * FROM shoelace_log;
|
SELECT * FROM shoelace_log;
|
||||||
|
|
||||||
sl_name | sl_avail | log_who | log_when
|
sl_name | sl_avail | log_who | log_when
|
||||||
---------+----------+---------+----------------------------------
|
---------+----------+---------+----------------------------------
|
||||||
sl7 | 6 | Al | Tue Oct 20 16:14:45 1998 MET DST
|
sl7 | 6 | Al | Tue Oct 20 16:14:45 1998 MET DST
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -1718,7 +1718,7 @@ SELECT * FROM shoelace ORDER BY sl_name;
|
|||||||
|
|
||||||
SELECT * FROM shoelace_log;
|
SELECT * FROM shoelace_log;
|
||||||
|
|
||||||
sl_name | sl_avail | log_who| log_when
|
sl_name | sl_avail | log_who| log_when
|
||||||
---------+----------+--------+----------------------------------
|
---------+----------+--------+----------------------------------
|
||||||
sl7 | 6 | Al | Tue Oct 20 19:14:45 1998 MET DST
|
sl7 | 6 | Al | Tue Oct 20 19:14:45 1998 MET DST
|
||||||
sl3 | 10 | Al | Tue Oct 20 19:25:16 1998 MET DST
|
sl3 | 10 | Al | Tue Oct 20 19:25:16 1998 MET DST
|
||||||
|
@@ -2625,7 +2625,7 @@ LANGUAGE SQL IMMUTABLE STRICT;
|
|||||||
to functions in <productname>PostgreSQL</productname>. An example is:
|
to functions in <productname>PostgreSQL</productname>. An example is:
|
||||||
<screen>
|
<screen>
|
||||||
SELECT concat_lower_or_upper('Hello', 'World', true);
|
SELECT concat_lower_or_upper('Hello', 'World', true);
|
||||||
concat_lower_or_upper
|
concat_lower_or_upper
|
||||||
-----------------------
|
-----------------------
|
||||||
HELLO WORLD
|
HELLO WORLD
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -2635,7 +2635,7 @@ SELECT concat_lower_or_upper('Hello', 'World', true);
|
|||||||
Another example is:
|
Another example is:
|
||||||
<screen>
|
<screen>
|
||||||
SELECT concat_lower_or_upper('Hello', 'World');
|
SELECT concat_lower_or_upper('Hello', 'World');
|
||||||
concat_lower_or_upper
|
concat_lower_or_upper
|
||||||
-----------------------
|
-----------------------
|
||||||
hello world
|
hello world
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -2661,7 +2661,7 @@ SELECT concat_lower_or_upper('Hello', 'World');
|
|||||||
For example:
|
For example:
|
||||||
<screen>
|
<screen>
|
||||||
SELECT concat_lower_or_upper(a => 'Hello', b => 'World');
|
SELECT concat_lower_or_upper(a => 'Hello', b => 'World');
|
||||||
concat_lower_or_upper
|
concat_lower_or_upper
|
||||||
-----------------------
|
-----------------------
|
||||||
hello world
|
hello world
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -2672,13 +2672,13 @@ SELECT concat_lower_or_upper(a => 'Hello', b => 'World');
|
|||||||
order, for example:
|
order, for example:
|
||||||
<screen>
|
<screen>
|
||||||
SELECT concat_lower_or_upper(a => 'Hello', b => 'World', uppercase => true);
|
SELECT concat_lower_or_upper(a => 'Hello', b => 'World', uppercase => true);
|
||||||
concat_lower_or_upper
|
concat_lower_or_upper
|
||||||
-----------------------
|
-----------------------
|
||||||
HELLO WORLD
|
HELLO WORLD
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT concat_lower_or_upper(a => 'Hello', uppercase => true, b => 'World');
|
SELECT concat_lower_or_upper(a => 'Hello', uppercase => true, b => 'World');
|
||||||
concat_lower_or_upper
|
concat_lower_or_upper
|
||||||
-----------------------
|
-----------------------
|
||||||
HELLO WORLD
|
HELLO WORLD
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -2689,7 +2689,7 @@ SELECT concat_lower_or_upper(a => 'Hello', uppercase => true, b => 'Wor
|
|||||||
An older syntax based on ":=" is supported for backward compatibility:
|
An older syntax based on ":=" is supported for backward compatibility:
|
||||||
<screen>
|
<screen>
|
||||||
SELECT concat_lower_or_upper(a := 'Hello', uppercase := true, b := 'World');
|
SELECT concat_lower_or_upper(a := 'Hello', uppercase := true, b := 'World');
|
||||||
concat_lower_or_upper
|
concat_lower_or_upper
|
||||||
-----------------------
|
-----------------------
|
||||||
HELLO WORLD
|
HELLO WORLD
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -2711,7 +2711,7 @@ SELECT concat_lower_or_upper(a := 'Hello', uppercase := true, b := 'World');
|
|||||||
For example:
|
For example:
|
||||||
<screen>
|
<screen>
|
||||||
SELECT concat_lower_or_upper('Hello', 'World', uppercase => true);
|
SELECT concat_lower_or_upper('Hello', 'World', uppercase => true);
|
||||||
concat_lower_or_upper
|
concat_lower_or_upper
|
||||||
-----------------------
|
-----------------------
|
||||||
HELLO WORLD
|
HELLO WORLD
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -45,7 +45,7 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'i
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
postgres[33712]=#* SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'stream-changes', '1');
|
postgres[33712]=#* SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'stream-changes', '1');
|
||||||
lsn | xid | data
|
lsn | xid | data
|
||||||
-----------+-----+--------------------------------------------------
|
-----------+-----+--------------------------------------------------
|
||||||
0/16B21F8 | 503 | opening a streamed block for transaction TXN 503
|
0/16B21F8 | 503 | opening a streamed block for transaction TXN 503
|
||||||
0/16B21F8 | 503 | streaming change for TXN 503
|
0/16B21F8 | 503 | streaming change for TXN 503
|
||||||
|
@@ -275,7 +275,7 @@ SELECT 'fat & cow'::tsquery @@ 'a fat cat sat on a mat and ate a fat rat'::t
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT to_tsvector('fat cats ate fat rats') @@ to_tsquery('fat & rat');
|
SELECT to_tsvector('fat cats ate fat rats') @@ to_tsquery('fat & rat');
|
||||||
?column?
|
?column?
|
||||||
----------
|
----------
|
||||||
t
|
t
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -284,7 +284,7 @@ SELECT to_tsvector('fat cats ate fat rats') @@ to_tsquery('fat & rat');
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT 'fat cats ate fat rats'::tsvector @@ to_tsquery('fat & rat');
|
SELECT 'fat cats ate fat rats'::tsvector @@ to_tsquery('fat & rat');
|
||||||
?column?
|
?column?
|
||||||
----------
|
----------
|
||||||
f
|
f
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -335,12 +335,12 @@ text @@ text
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT to_tsvector('fatal error') @@ to_tsquery('fatal <-> error');
|
SELECT to_tsvector('fatal error') @@ to_tsquery('fatal <-> error');
|
||||||
?column?
|
?column?
|
||||||
----------
|
----------
|
||||||
t
|
t
|
||||||
|
|
||||||
SELECT to_tsvector('error is not fatal') @@ to_tsquery('fatal <-> error');
|
SELECT to_tsvector('error is not fatal') @@ to_tsquery('fatal <-> error');
|
||||||
?column?
|
?column?
|
||||||
----------
|
----------
|
||||||
f
|
f
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -357,12 +357,12 @@ SELECT to_tsvector('error is not fatal') @@ to_tsquery('fatal <-> error');
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT phraseto_tsquery('cats ate rats');
|
SELECT phraseto_tsquery('cats ate rats');
|
||||||
phraseto_tsquery
|
phraseto_tsquery
|
||||||
-------------------------------
|
-------------------------------
|
||||||
'cat' <-> 'ate' <-> 'rat'
|
'cat' <-> 'ate' <-> 'rat'
|
||||||
|
|
||||||
SELECT phraseto_tsquery('the cats ate the rats');
|
SELECT phraseto_tsquery('the cats ate the rats');
|
||||||
phraseto_tsquery
|
phraseto_tsquery
|
||||||
-------------------------------
|
-------------------------------
|
||||||
'cat' <-> 'ate' <2> 'rat'
|
'cat' <-> 'ate' <2> 'rat'
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -828,7 +828,7 @@ to_tsquery(<optional> <replaceable class="parameter">config</replaceable> <type>
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT to_tsquery('english', 'The & Fat & Rats');
|
SELECT to_tsquery('english', 'The & Fat & Rats');
|
||||||
to_tsquery
|
to_tsquery
|
||||||
---------------
|
---------------
|
||||||
'fat' & 'rat'
|
'fat' & 'rat'
|
||||||
</screen>
|
</screen>
|
||||||
@@ -839,7 +839,7 @@ SELECT to_tsquery('english', 'The & Fat & Rats');
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT to_tsquery('english', 'Fat | Rats:AB');
|
SELECT to_tsquery('english', 'Fat | Rats:AB');
|
||||||
to_tsquery
|
to_tsquery
|
||||||
------------------
|
------------------
|
||||||
'fat' | 'rat':AB
|
'fat' | 'rat':AB
|
||||||
</screen>
|
</screen>
|
||||||
@@ -848,7 +848,7 @@ SELECT to_tsquery('english', 'Fat | Rats:AB');
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT to_tsquery('supern:*A & star:A*B');
|
SELECT to_tsquery('supern:*A & star:A*B');
|
||||||
to_tsquery
|
to_tsquery
|
||||||
--------------------------
|
--------------------------
|
||||||
'supern':*A & 'star':*AB
|
'supern':*A & 'star':*AB
|
||||||
</screen>
|
</screen>
|
||||||
@@ -897,7 +897,7 @@ plainto_tsquery(<optional> <replaceable class="parameter">config</replaceable> <
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT plainto_tsquery('english', 'The Fat Rats');
|
SELECT plainto_tsquery('english', 'The Fat Rats');
|
||||||
plainto_tsquery
|
plainto_tsquery
|
||||||
-----------------
|
-----------------
|
||||||
'fat' & 'rat'
|
'fat' & 'rat'
|
||||||
</screen>
|
</screen>
|
||||||
@@ -908,7 +908,7 @@ SELECT plainto_tsquery('english', 'The Fat Rats');
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT plainto_tsquery('english', 'The Fat & Rats:C');
|
SELECT plainto_tsquery('english', 'The Fat & Rats:C');
|
||||||
plainto_tsquery
|
plainto_tsquery
|
||||||
---------------------
|
---------------------
|
||||||
'fat' & 'rat' & 'c'
|
'fat' & 'rat' & 'c'
|
||||||
</screen>
|
</screen>
|
||||||
@@ -1827,7 +1827,7 @@ CREATE TABLE aliases (t tsquery primary key, s tsquery);
|
|||||||
INSERT INTO aliases VALUES(to_tsquery('supernovae'), to_tsquery('supernovae|sn'));
|
INSERT INTO aliases VALUES(to_tsquery('supernovae'), to_tsquery('supernovae|sn'));
|
||||||
|
|
||||||
SELECT ts_rewrite(to_tsquery('supernovae & crab'), 'SELECT * FROM aliases');
|
SELECT ts_rewrite(to_tsquery('supernovae & crab'), 'SELECT * FROM aliases');
|
||||||
ts_rewrite
|
ts_rewrite
|
||||||
---------------------------------
|
---------------------------------
|
||||||
'crab' & ( 'supernova' | 'sn' )
|
'crab' & ( 'supernova' | 'sn' )
|
||||||
</screen>
|
</screen>
|
||||||
@@ -1840,7 +1840,7 @@ SET s = to_tsquery('supernovae|sn & !nebulae')
|
|||||||
WHERE t = to_tsquery('supernovae');
|
WHERE t = to_tsquery('supernovae');
|
||||||
|
|
||||||
SELECT ts_rewrite(to_tsquery('supernovae & crab'), 'SELECT * FROM aliases');
|
SELECT ts_rewrite(to_tsquery('supernovae & crab'), 'SELECT * FROM aliases');
|
||||||
ts_rewrite
|
ts_rewrite
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
'crab' & ( 'supernova' | 'sn' & !'nebula' )
|
'crab' & ( 'supernova' | 'sn' & !'nebula' )
|
||||||
</screen>
|
</screen>
|
||||||
@@ -1915,12 +1915,12 @@ tsvector_update_trigger(tsv, 'pg_catalog.english', title, body);
|
|||||||
INSERT INTO messages VALUES('title here', 'the body text is here');
|
INSERT INTO messages VALUES('title here', 'the body text is here');
|
||||||
|
|
||||||
SELECT * FROM messages;
|
SELECT * FROM messages;
|
||||||
title | body | tsv
|
title | body | tsv
|
||||||
------------+-----------------------+----------------------------
|
------------+-----------------------+----------------------------
|
||||||
title here | the body text is here | 'bodi':4 'text':5 'titl':1
|
title here | the body text is here | 'bodi':4 'text':5 'titl':1
|
||||||
|
|
||||||
SELECT title, body FROM messages WHERE tsv @@ to_tsquery('title & body');
|
SELECT title, body FROM messages WHERE tsv @@ to_tsquery('title & body');
|
||||||
title | body
|
title | body
|
||||||
------------+-----------------------
|
------------+-----------------------
|
||||||
title here | the body text is here
|
title here | the body text is here
|
||||||
</screen>
|
</screen>
|
||||||
@@ -2231,7 +2231,7 @@ LIMIT 10;
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT alias, description, token FROM ts_debug('foo-bar-beta1');
|
SELECT alias, description, token FROM ts_debug('foo-bar-beta1');
|
||||||
alias | description | token
|
alias | description | token
|
||||||
-----------------+------------------------------------------+---------------
|
-----------------+------------------------------------------+---------------
|
||||||
numhword | Hyphenated word, letters and digits | foo-bar-beta1
|
numhword | Hyphenated word, letters and digits | foo-bar-beta1
|
||||||
hword_asciipart | Hyphenated word part, all ASCII | foo
|
hword_asciipart | Hyphenated word part, all ASCII | foo
|
||||||
@@ -2247,7 +2247,7 @@ SELECT alias, description, token FROM ts_debug('foo-bar-beta1');
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT alias, description, token FROM ts_debug('http://example.com/stuff/index.html');
|
SELECT alias, description, token FROM ts_debug('http://example.com/stuff/index.html');
|
||||||
alias | description | token
|
alias | description | token
|
||||||
----------+---------------+------------------------------
|
----------+---------------+------------------------------
|
||||||
protocol | Protocol head | http://
|
protocol | Protocol head | http://
|
||||||
url | URL | example.com/stuff/index.html
|
url | URL | example.com/stuff/index.html
|
||||||
@@ -2571,7 +2571,7 @@ SELECT ts_lexize('public.simple_dict', 'The');
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT * FROM ts_debug('english', 'Paris');
|
SELECT * FROM ts_debug('english', 'Paris');
|
||||||
alias | description | token | dictionaries | dictionary | lexemes
|
alias | description | token | dictionaries | dictionary | lexemes
|
||||||
-----------+-----------------+-------+----------------+--------------+---------
|
-----------+-----------------+-------+----------------+--------------+---------
|
||||||
asciiword | Word, all ASCII | Paris | {english_stem} | english_stem | {pari}
|
asciiword | Word, all ASCII | Paris | {english_stem} | english_stem | {pari}
|
||||||
|
|
||||||
@@ -2585,7 +2585,7 @@ ALTER TEXT SEARCH CONFIGURATION english
|
|||||||
WITH my_synonym, english_stem;
|
WITH my_synonym, english_stem;
|
||||||
|
|
||||||
SELECT * FROM ts_debug('english', 'Paris');
|
SELECT * FROM ts_debug('english', 'Paris');
|
||||||
alias | description | token | dictionaries | dictionary | lexemes
|
alias | description | token | dictionaries | dictionary | lexemes
|
||||||
-----------+-----------------+-------+---------------------------+------------+---------
|
-----------+-----------------+-------+---------------------------+------------+---------
|
||||||
asciiword | Word, all ASCII | Paris | {my_synonym,english_stem} | my_synonym | {paris}
|
asciiword | Word, all ASCII | Paris | {my_synonym,english_stem} | my_synonym | {paris}
|
||||||
</screen>
|
</screen>
|
||||||
@@ -2654,7 +2654,7 @@ mydb=# SELECT to_tsquery('tst', 'indices');
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
mydb=# SELECT 'indexes are very useful'::tsvector;
|
mydb=# SELECT 'indexes are very useful'::tsvector;
|
||||||
tsvector
|
tsvector
|
||||||
---------------------------------
|
---------------------------------
|
||||||
'are' 'indexes' 'useful' 'very'
|
'are' 'indexes' 'useful' 'very'
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -3355,31 +3355,31 @@ ts_debug(<optional> <replaceable class="parameter">config</replaceable> <type>re
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT * FROM ts_debug('english', 'a fat cat sat on a mat - it ate a fat rats');
|
SELECT * FROM ts_debug('english', 'a fat cat sat on a mat - it ate a fat rats');
|
||||||
alias | description | token | dictionaries | dictionary | lexemes
|
alias | description | token | dictionaries | dictionary | lexemes
|
||||||
-----------+-----------------+-------+----------------+--------------+---------
|
-----------+-----------------+-------+----------------+--------------+---------
|
||||||
asciiword | Word, all ASCII | a | {english_stem} | english_stem | {}
|
asciiword | Word, all ASCII | a | {english_stem} | english_stem | {}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | fat | {english_stem} | english_stem | {fat}
|
asciiword | Word, all ASCII | fat | {english_stem} | english_stem | {fat}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | cat | {english_stem} | english_stem | {cat}
|
asciiword | Word, all ASCII | cat | {english_stem} | english_stem | {cat}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | sat | {english_stem} | english_stem | {sat}
|
asciiword | Word, all ASCII | sat | {english_stem} | english_stem | {sat}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | on | {english_stem} | english_stem | {}
|
asciiword | Word, all ASCII | on | {english_stem} | english_stem | {}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | a | {english_stem} | english_stem | {}
|
asciiword | Word, all ASCII | a | {english_stem} | english_stem | {}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | mat | {english_stem} | english_stem | {mat}
|
asciiword | Word, all ASCII | mat | {english_stem} | english_stem | {mat}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
blank | Space symbols | - | {} | |
|
blank | Space symbols | - | {} | |
|
||||||
asciiword | Word, all ASCII | it | {english_stem} | english_stem | {}
|
asciiword | Word, all ASCII | it | {english_stem} | english_stem | {}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | ate | {english_stem} | english_stem | {ate}
|
asciiword | Word, all ASCII | ate | {english_stem} | english_stem | {ate}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | a | {english_stem} | english_stem | {}
|
asciiword | Word, all ASCII | a | {english_stem} | english_stem | {}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | fat | {english_stem} | english_stem | {fat}
|
asciiword | Word, all ASCII | fat | {english_stem} | english_stem | {fat}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | rats | {english_stem} | english_stem | {rat}
|
asciiword | Word, all ASCII | rats | {english_stem} | english_stem | {rat}
|
||||||
</screen>
|
</screen>
|
||||||
</para>
|
</para>
|
||||||
@@ -3406,12 +3406,12 @@ ALTER TEXT SEARCH CONFIGURATION public.english
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT * FROM ts_debug('public.english', 'The Brightest supernovaes');
|
SELECT * FROM ts_debug('public.english', 'The Brightest supernovaes');
|
||||||
alias | description | token | dictionaries | dictionary | lexemes
|
alias | description | token | dictionaries | dictionary | lexemes
|
||||||
-----------+-----------------+-------------+-------------------------------+----------------+-------------
|
-----------+-----------------+-------------+-------------------------------+----------------+-------------
|
||||||
asciiword | Word, all ASCII | The | {english_ispell,english_stem} | english_ispell | {}
|
asciiword | Word, all ASCII | The | {english_ispell,english_stem} | english_ispell | {}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | Brightest | {english_ispell,english_stem} | english_ispell | {bright}
|
asciiword | Word, all ASCII | Brightest | {english_ispell,english_stem} | english_ispell | {bright}
|
||||||
blank | Space symbols | | {} | |
|
blank | Space symbols | | {} | |
|
||||||
asciiword | Word, all ASCII | supernovaes | {english_ispell,english_stem} | english_stem | {supernova}
|
asciiword | Word, all ASCII | supernovaes | {english_ispell,english_stem} | english_stem | {supernova}
|
||||||
</screen>
|
</screen>
|
||||||
|
|
||||||
@@ -3445,12 +3445,12 @@ SELECT * FROM ts_debug('public.english', 'The Brightest supernovaes');
|
|||||||
<screen>
|
<screen>
|
||||||
SELECT alias, token, dictionary, lexemes
|
SELECT alias, token, dictionary, lexemes
|
||||||
FROM ts_debug('public.english', 'The Brightest supernovaes');
|
FROM ts_debug('public.english', 'The Brightest supernovaes');
|
||||||
alias | token | dictionary | lexemes
|
alias | token | dictionary | lexemes
|
||||||
-----------+-------------+----------------+-------------
|
-----------+-------------+----------------+-------------
|
||||||
asciiword | The | english_ispell | {}
|
asciiword | The | english_ispell | {}
|
||||||
blank | | |
|
blank | | |
|
||||||
asciiword | Brightest | english_ispell | {bright}
|
asciiword | Brightest | english_ispell | {bright}
|
||||||
blank | | |
|
blank | | |
|
||||||
asciiword | supernovaes | english_stem | {supernova}
|
asciiword | supernovaes | english_stem | {supernova}
|
||||||
</screen>
|
</screen>
|
||||||
</para>
|
</para>
|
||||||
@@ -3516,7 +3516,7 @@ ts_token_type(<replaceable class="parameter">parser_oid</replaceable> <type>oid<
|
|||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT * FROM ts_token_type('default');
|
SELECT * FROM ts_token_type('default');
|
||||||
tokid | alias | description
|
tokid | alias | description
|
||||||
-------+-----------------+------------------------------------------
|
-------+-----------------+------------------------------------------
|
||||||
1 | asciiword | Word, all ASCII
|
1 | asciiword | Word, all ASCII
|
||||||
2 | word | Word, all letters
|
2 | word | Word, all letters
|
||||||
@@ -3799,14 +3799,14 @@ SELECT plainto_tsquery('supernovae stars');
|
|||||||
<screen>
|
<screen>
|
||||||
=> \dF russian
|
=> \dF russian
|
||||||
List of text search configurations
|
List of text search configurations
|
||||||
Schema | Name | Description
|
Schema | Name | Description
|
||||||
------------+---------+------------------------------------
|
------------+---------+------------------------------------
|
||||||
pg_catalog | russian | configuration for russian language
|
pg_catalog | russian | configuration for russian language
|
||||||
|
|
||||||
=> \dF+ russian
|
=> \dF+ russian
|
||||||
Text search configuration "pg_catalog.russian"
|
Text search configuration "pg_catalog.russian"
|
||||||
Parser: "pg_catalog.default"
|
Parser: "pg_catalog.default"
|
||||||
Token | Dictionaries
|
Token | Dictionaries
|
||||||
-----------------+--------------
|
-----------------+--------------
|
||||||
asciihword | english_stem
|
asciihword | english_stem
|
||||||
asciiword | english_stem
|
asciiword | english_stem
|
||||||
@@ -3884,21 +3884,21 @@ Parser: "pg_catalog.default"
|
|||||||
<screen>
|
<screen>
|
||||||
=> \dFp
|
=> \dFp
|
||||||
List of text search parsers
|
List of text search parsers
|
||||||
Schema | Name | Description
|
Schema | Name | Description
|
||||||
------------+---------+---------------------
|
------------+---------+---------------------
|
||||||
pg_catalog | default | default word parser
|
pg_catalog | default | default word parser
|
||||||
=> \dFp+
|
=> \dFp+
|
||||||
Text search parser "pg_catalog.default"
|
Text search parser "pg_catalog.default"
|
||||||
Method | Function | Description
|
Method | Function | Description
|
||||||
-----------------+----------------+-------------
|
-----------------+----------------+-------------
|
||||||
Start parse | prsd_start |
|
Start parse | prsd_start |
|
||||||
Get next token | prsd_nexttoken |
|
Get next token | prsd_nexttoken |
|
||||||
End parse | prsd_end |
|
End parse | prsd_end |
|
||||||
Get headline | prsd_headline |
|
Get headline | prsd_headline |
|
||||||
Get token types | prsd_lextype |
|
Get token types | prsd_lextype |
|
||||||
|
|
||||||
Token types for parser "pg_catalog.default"
|
Token types for parser "pg_catalog.default"
|
||||||
Token name | Description
|
Token name | Description
|
||||||
-----------------+------------------------------------------
|
-----------------+------------------------------------------
|
||||||
asciihword | Hyphenated word, all ASCII
|
asciihword | Hyphenated word, all ASCII
|
||||||
asciiword | Word, all ASCII
|
asciiword | Word, all ASCII
|
||||||
@@ -3937,7 +3937,7 @@ Parser: "pg_catalog.default"
|
|||||||
<screen>
|
<screen>
|
||||||
=> \dFt
|
=> \dFt
|
||||||
List of text search templates
|
List of text search templates
|
||||||
Schema | Name | Description
|
Schema | Name | Description
|
||||||
------------+-----------+-----------------------------------------------------------
|
------------+-----------+-----------------------------------------------------------
|
||||||
pg_catalog | ispell | ispell dictionary
|
pg_catalog | ispell | ispell dictionary
|
||||||
pg_catalog | simple | simple dictionary: just lower case and check for stopword
|
pg_catalog | simple | simple dictionary: just lower case and check for stopword
|
||||||
|
@@ -322,7 +322,7 @@ SELECT attrelid::regclass, array_accum(attname)
|
|||||||
WHERE attnum > 0 AND attrelid = 'pg_tablespace'::regclass
|
WHERE attnum > 0 AND attrelid = 'pg_tablespace'::regclass
|
||||||
GROUP BY attrelid;
|
GROUP BY attrelid;
|
||||||
|
|
||||||
attrelid | array_accum
|
attrelid | array_accum
|
||||||
---------------+---------------------------------------
|
---------------+---------------------------------------
|
||||||
pg_tablespace | {spcname,spcowner,spcacl,spcoptions}
|
pg_tablespace | {spcname,spcowner,spcacl,spcoptions}
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -332,7 +332,7 @@ SELECT attrelid::regclass, array_accum(atttypid::regtype)
|
|||||||
WHERE attnum > 0 AND attrelid = 'pg_tablespace'::regclass
|
WHERE attnum > 0 AND attrelid = 'pg_tablespace'::regclass
|
||||||
GROUP BY attrelid;
|
GROUP BY attrelid;
|
||||||
|
|
||||||
attrelid | array_accum
|
attrelid | array_accum
|
||||||
---------------+---------------------------
|
---------------+---------------------------
|
||||||
pg_tablespace | {name,oid,aclitem[],text[]}
|
pg_tablespace | {name,oid,aclitem[],text[]}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
@@ -836,7 +836,7 @@ CREATE FUNCTION mleast(VARIADIC arr numeric[]) RETURNS numeric AS $$
|
|||||||
$$ LANGUAGE SQL;
|
$$ LANGUAGE SQL;
|
||||||
|
|
||||||
SELECT mleast(10, -1, 5, 4.4);
|
SELECT mleast(10, -1, 5, 4.4);
|
||||||
mleast
|
mleast
|
||||||
--------
|
--------
|
||||||
-1
|
-1
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -942,19 +942,19 @@ AS $$
|
|||||||
$$;
|
$$;
|
||||||
|
|
||||||
SELECT foo(10, 20, 30);
|
SELECT foo(10, 20, 30);
|
||||||
foo
|
foo
|
||||||
-----
|
-----
|
||||||
60
|
60
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT foo(10, 20);
|
SELECT foo(10, 20);
|
||||||
foo
|
foo
|
||||||
-----
|
-----
|
||||||
33
|
33
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT foo(10);
|
SELECT foo(10);
|
||||||
foo
|
foo
|
||||||
-----
|
-----
|
||||||
15
|
15
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -1387,7 +1387,7 @@ SELECT make_array2(1, 2.5) AS numericarray;
|
|||||||
also works:
|
also works:
|
||||||
<screen>
|
<screen>
|
||||||
SELECT make_array2('a', 'b') AS textarray;
|
SELECT make_array2('a', 'b') AS textarray;
|
||||||
textarray
|
textarray
|
||||||
-----------
|
-----------
|
||||||
{a,b}
|
{a,b}
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -1440,13 +1440,13 @@ CREATE FUNCTION anyleast (VARIADIC anyarray) RETURNS anyelement AS $$
|
|||||||
$$ LANGUAGE SQL;
|
$$ LANGUAGE SQL;
|
||||||
|
|
||||||
SELECT anyleast(10, -1, 5, 4);
|
SELECT anyleast(10, -1, 5, 4);
|
||||||
anyleast
|
anyleast
|
||||||
----------
|
----------
|
||||||
-1
|
-1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT anyleast('abc'::text, 'def');
|
SELECT anyleast('abc'::text, 'def');
|
||||||
anyleast
|
anyleast
|
||||||
----------
|
----------
|
||||||
abc
|
abc
|
||||||
(1 row)
|
(1 row)
|
||||||
@@ -1456,7 +1456,7 @@ CREATE FUNCTION concat_values(text, VARIADIC anyarray) RETURNS text AS $$
|
|||||||
$$ LANGUAGE SQL;
|
$$ LANGUAGE SQL;
|
||||||
|
|
||||||
SELECT concat_values('|', 1, 4, 2);
|
SELECT concat_values('|', 1, 4, 2);
|
||||||
concat_values
|
concat_values
|
||||||
---------------
|
---------------
|
||||||
1|4|2
|
1|4|2
|
||||||
(1 row)
|
(1 row)
|
||||||
|
Reference in New Issue
Block a user