mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
docs: HTML-escape '>' in '=>' using HTML entities
This commit is contained in:
parent
b8fe12a836
commit
e641d7b22f
@ -1742,9 +1742,9 @@ GRANT UPDATE
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
-- admin can view all rows and fields
|
-- admin can view all rows and fields
|
||||||
postgres=> set role admin;
|
postgres=> set role admin;
|
||||||
SET
|
SET
|
||||||
postgres=> table passwd;
|
postgres=> table passwd;
|
||||||
username | pwhash | uid | gid | real_name | home_phone | extra_info | home_dir | shell
|
username | pwhash | uid | gid | real_name | home_phone | extra_info | home_dir | shell
|
||||||
----------+--------+-----+-----+-----------+--------------+------------+-------------+-----------
|
----------+--------+-----+-----+-----------+--------------+------------+-------------+-----------
|
||||||
admin | xxx | 0 | 0 | Admin | 111-222-3333 | | /root | /bin/dash
|
admin | xxx | 0 | 0 | Admin | 111-222-3333 | | /root | /bin/dash
|
||||||
@ -1753,11 +1753,11 @@ postgres=> table passwd;
|
|||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
-- Test what Alice is able to do
|
-- Test what Alice is able to do
|
||||||
postgres=> set role alice;
|
postgres=> set role alice;
|
||||||
SET
|
SET
|
||||||
postgres=> table passwd;
|
postgres=> table passwd;
|
||||||
ERROR: permission denied for relation passwd
|
ERROR: permission denied for relation passwd
|
||||||
postgres=> select username,real_name,home_phone,extra_info,home_dir,shell from passwd;
|
postgres=> select username,real_name,home_phone,extra_info,home_dir,shell from passwd;
|
||||||
username | real_name | home_phone | extra_info | home_dir | shell
|
username | real_name | home_phone | extra_info | home_dir | shell
|
||||||
----------+-----------+--------------+------------+-------------+-----------
|
----------+-----------+--------------+------------+-------------+-----------
|
||||||
admin | Admin | 111-222-3333 | | /root | /bin/dash
|
admin | Admin | 111-222-3333 | | /root | /bin/dash
|
||||||
@ -1765,21 +1765,21 @@ postgres=> select username,real_name,home_phone,extra_info,home_dir,shell from p
|
|||||||
alice | Alice | 098-765-4321 | | /home/alice | /bin/zsh
|
alice | Alice | 098-765-4321 | | /home/alice | /bin/zsh
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
postgres=> update passwd set username = 'joe';
|
postgres=> update passwd set username = 'joe';
|
||||||
ERROR: permission denied for relation passwd
|
ERROR: permission denied for relation passwd
|
||||||
-- Allowed to change her own real_name, but no others
|
-- Allowed to change her own real_name, but no others
|
||||||
postgres=> update passwd set real_name = 'Alice Doe';
|
postgres=> update passwd set real_name = 'Alice Doe';
|
||||||
UPDATE 1
|
UPDATE 1
|
||||||
postgres=> update passwd set real_name = 'John Doe' where username = 'admin';
|
postgres=> update passwd set real_name = 'John Doe' where username = 'admin';
|
||||||
UPDATE 0
|
UPDATE 0
|
||||||
postgres=> update passwd set shell = '/bin/xx';
|
postgres=> update passwd set shell = '/bin/xx';
|
||||||
ERROR: new row violates WITH CHECK OPTION for "passwd"
|
ERROR: new row violates WITH CHECK OPTION for "passwd"
|
||||||
postgres=> delete from passwd;
|
postgres=> delete from passwd;
|
||||||
ERROR: permission denied for relation passwd
|
ERROR: permission denied for relation passwd
|
||||||
postgres=> insert into passwd (username) values ('xxx');
|
postgres=> insert into passwd (username) values ('xxx');
|
||||||
ERROR: permission denied for relation passwd
|
ERROR: permission denied for relation passwd
|
||||||
-- Alice can change her own password
|
-- Alice can change her own password
|
||||||
postgres=> update passwd set pwhash = 'abc';
|
postgres=> update passwd set pwhash = 'abc';
|
||||||
UPDATE 1
|
UPDATE 1
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
|
@ -1404,7 +1404,7 @@ CREATE TABLE t3 (
|
|||||||
ii integer[]
|
ii integer[]
|
||||||
);
|
);
|
||||||
|
|
||||||
testdb=> SELECT * FROM t3;
|
testdb=> SELECT * FROM t3;
|
||||||
ii
|
ii
|
||||||
-------------
|
-------------
|
||||||
{1,2,3,4,5}
|
{1,2,3,4,5}
|
||||||
|
@ -6813,7 +6813,7 @@ SELECT regexp_matches('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}');
|
|||||||
Create interval from years, months, weeks, days, hours, minutes and
|
Create interval from years, months, weeks, days, hours, minutes and
|
||||||
seconds fields
|
seconds fields
|
||||||
</entry>
|
</entry>
|
||||||
<entry><literal>make_interval(days => 10)</literal></entry>
|
<entry><literal>make_interval(days => 10)</literal></entry>
|
||||||
<entry><literal>10 days</literal></entry>
|
<entry><literal>10 days</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ b
|
|||||||
<entry><type>hstore</type></entry>
|
<entry><type>hstore</type></entry>
|
||||||
<entry>delete pair with matching key</entry>
|
<entry>delete pair with matching key</entry>
|
||||||
<entry><literal>delete('a=>1,b=>2','b')</literal></entry>
|
<entry><literal>delete('a=>1,b=>2','b')</literal></entry>
|
||||||
<entry><literal>"a"=>"1"</literal></entry>
|
<entry><literal>"a"=>"1"</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -389,7 +389,7 @@ b
|
|||||||
<entry><type>hstore</type></entry>
|
<entry><type>hstore</type></entry>
|
||||||
<entry>delete pairs with matching keys</entry>
|
<entry>delete pairs with matching keys</entry>
|
||||||
<entry><literal>delete('a=>1,b=>2,c=>3',ARRAY['a','b'])</literal></entry>
|
<entry><literal>delete('a=>1,b=>2,c=>3',ARRAY['a','b'])</literal></entry>
|
||||||
<entry><literal>"c"=>"3"</literal></entry>
|
<entry><literal>"c"=>"3"</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -397,7 +397,7 @@ b
|
|||||||
<entry><type>hstore</type></entry>
|
<entry><type>hstore</type></entry>
|
||||||
<entry>delete pairs matching those in the second argument</entry>
|
<entry>delete pairs matching those in the second argument</entry>
|
||||||
<entry><literal>delete('a=>1,b=>2','a=>4,b=>2'::hstore)</literal></entry>
|
<entry><literal>delete('a=>1,b=>2','a=>4,b=>2'::hstore)</literal></entry>
|
||||||
<entry><literal>"a"=>"1"</literal></entry>
|
<entry><literal>"a"=>"1"</literal></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
target relation's name (optionally schema-qualified) or OID.
|
target relation's name (optionally schema-qualified) or OID.
|
||||||
For example:
|
For example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test=> SELECT * FROM pgstattuple('pg_catalog.pg_proc');
|
test=> SELECT * FROM pgstattuple('pg_catalog.pg_proc');
|
||||||
-[ RECORD 1 ]------+-------
|
-[ RECORD 1 ]------+-------
|
||||||
table_len | 458752
|
table_len | 458752
|
||||||
tuple_count | 1470
|
tuple_count | 1470
|
||||||
@ -150,7 +150,7 @@ free_percent | 1.95
|
|||||||
<function>pgstatindex</function> returns a record showing information
|
<function>pgstatindex</function> returns a record showing information
|
||||||
about a B-tree index. For example:
|
about a B-tree index. For example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test=> SELECT * FROM pgstatindex('pg_cast_oid_index');
|
test=> SELECT * FROM pgstatindex('pg_cast_oid_index');
|
||||||
-[ RECORD 1 ]------+------
|
-[ RECORD 1 ]------+------
|
||||||
version | 2
|
version | 2
|
||||||
tree_level | 0
|
tree_level | 0
|
||||||
@ -280,7 +280,7 @@ leaf_fragmentation | 0
|
|||||||
<function>pgstatginindex</function> returns a record showing information
|
<function>pgstatginindex</function> returns a record showing information
|
||||||
about a GIN index. For example:
|
about a GIN index. For example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test=> SELECT * FROM pgstatginindex('test_gin_index');
|
test=> SELECT * FROM pgstatginindex('test_gin_index');
|
||||||
-[ RECORD 1 ]--+--
|
-[ RECORD 1 ]--+--
|
||||||
version | 1
|
version | 1
|
||||||
pending_pages | 0
|
pending_pages | 0
|
||||||
@ -373,7 +373,7 @@ pending_tuples | 0
|
|||||||
The argument is the target relation's OID.
|
The argument is the target relation's OID.
|
||||||
For example:
|
For example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
test=> SELECT * FROM pgstattuple_approx('pg_catalog.pg_proc'::regclass);
|
test=> SELECT * FROM pgstattuple_approx('pg_catalog.pg_proc'::regclass);
|
||||||
-[ RECORD 1 ]--------+-------
|
-[ RECORD 1 ]--------+-------
|
||||||
table_len | 573440
|
table_len | 573440
|
||||||
scanned_percent | 2
|
scanned_percent | 2
|
||||||
|
@ -1885,7 +1885,7 @@ SELECT 3, 'three';
|
|||||||
it's usually better to override the default names with a table alias
|
it's usually better to override the default names with a table alias
|
||||||
list, like this:
|
list, like this:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
=> SELECT * FROM (VALUES (1, 'one'), (2, 'two'), (3, 'three')) AS t (num,letter);
|
=> SELECT * FROM (VALUES (1, 'one'), (2, 'two'), (3, 'three')) AS t (num,letter);
|
||||||
num | letter
|
num | letter
|
||||||
-----+--------
|
-----+--------
|
||||||
1 | one
|
1 | one
|
||||||
|
@ -2100,7 +2100,7 @@ CREATE VIEW phone_number AS
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE FUNCTION tricky(text, text) RETURNS bool AS $$
|
CREATE FUNCTION tricky(text, text) RETURNS bool AS $$
|
||||||
BEGIN
|
BEGIN
|
||||||
RAISE NOTICE '% => %', $1, $2;
|
RAISE NOTICE '% => %', $1, $2;
|
||||||
RETURN true;
|
RETURN true;
|
||||||
END
|
END
|
||||||
$$ LANGUAGE plpgsql COST 0.0000000000000000000001;
|
$$ LANGUAGE plpgsql COST 0.0000000000000000000001;
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
when you fetch it? Watch:
|
when you fetch it? Watch:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
test=> select 6.50 :: float8 as "pH";
|
test=> select 6.50 :: float8 as "pH";
|
||||||
pH
|
pH
|
||||||
---
|
---
|
||||||
6.5
|
6.5
|
||||||
@ -66,7 +66,7 @@ test=> select 6.50 :: float8 as "pH";
|
|||||||
Check this out:
|
Check this out:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
test=> select '6.25 .. 6.50'::seg as "pH";
|
test=> select '6.25 .. 6.50'::seg as "pH";
|
||||||
pH
|
pH
|
||||||
------------
|
------------
|
||||||
6.25 .. 6.50
|
6.25 .. 6.50
|
||||||
@ -359,7 +359,7 @@ test=> select '6.25 .. 6.50'::seg as "pH";
|
|||||||
boundary if the resulting interval includes a power of ten:
|
boundary if the resulting interval includes a power of ten:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
postgres=> select '10(+-)1'::seg as seg;
|
postgres=> select '10(+-)1'::seg as seg;
|
||||||
seg
|
seg
|
||||||
---------
|
---------
|
||||||
9.0 .. 11 -- should be: 9 .. 11
|
9.0 .. 11 -- should be: 9 .. 11
|
||||||
|
@ -2592,10 +2592,10 @@ SELECT concat_lower_or_upper('Hello', 'World');
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
In named notation, each argument's name is specified using
|
In named notation, each argument's name is specified using
|
||||||
<literal>=></literal> to separate it from the argument expression.
|
<literal>=></literal> to separate it from the argument expression.
|
||||||
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
|
||||||
@ -2606,13 +2606,13 @@ SELECT concat_lower_or_upper(a => 'Hello', b => 'World');
|
|||||||
using named notation is that the arguments may be specified in any
|
using named notation is that the arguments may be specified in any
|
||||||
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
|
||||||
@ -2645,7 +2645,7 @@ SELECT concat_lower_or_upper(a => 'Hello', uppercase => true, b => 'World');
|
|||||||
already mentioned, named arguments cannot precede positional arguments.
|
already mentioned, named arguments cannot precede positional arguments.
|
||||||
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
|
||||||
|
@ -776,14 +776,14 @@ SELECT mleast(VARIADIC ARRAY[]::numeric[]);
|
|||||||
<literal>VARIADIC</>. For example, this will work:
|
<literal>VARIADIC</>. For example, this will work:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT mleast(VARIADIC arr => ARRAY[10, -1, 5, 4.4]);
|
SELECT mleast(VARIADIC arr => ARRAY[10, -1, 5, 4.4]);
|
||||||
</screen>
|
</screen>
|
||||||
|
|
||||||
but not these:
|
but not these:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
SELECT mleast(arr => 10);
|
SELECT mleast(arr => 10);
|
||||||
SELECT mleast(arr => ARRAY[10, -1, 5, 4.4]);
|
SELECT mleast(arr => ARRAY[10, -1, 5, 4.4]);
|
||||||
</screen>
|
</screen>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user