summaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/sgml/ref')
-rw-r--r--doc/src/sgml/ref/alter_table.sgml2
-rw-r--r--doc/src/sgml/ref/create_function.sgml6
-rw-r--r--doc/src/sgml/ref/create_table.sgml12
-rw-r--r--doc/src/sgml/ref/pg_rewind.sgml8
-rw-r--r--doc/src/sgml/ref/psql-ref.sgml16
-rw-r--r--doc/src/sgml/ref/select.sgml2
6 files changed, 23 insertions, 23 deletions
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index bea9f90138b..9d23ad5a0fb 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -1642,7 +1642,7 @@ ALTER TABLE measurements
<programlisting>
ALTER TABLE transactions
ADD COLUMN status varchar(30) DEFAULT 'old',
- ALTER COLUMN status SET default 'current';
+ ALTER COLUMN status SET DEFAULT 'current';
</programlisting>
Existing rows will be filled with <literal>old</literal>, but then
the default for subsequent commands will be <literal>current</literal>.
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml
index 0d240484cd3..e748e842353 100644
--- a/doc/src/sgml/ref/create_function.sgml
+++ b/doc/src/sgml/ref/create_function.sgml
@@ -649,7 +649,7 @@ END
parameters. Thus for example these declarations conflict:
<programlisting>
CREATE FUNCTION foo(int) ...
-CREATE FUNCTION foo(int, out text) ...
+CREATE FUNCTION foo(int, OUT text) ...
</programlisting>
</para>
@@ -709,7 +709,7 @@ CREATE FUNCTION foo(int, int default 42) ...
Add two integers using an SQL function:
<programlisting>
CREATE FUNCTION add(integer, integer) RETURNS integer
- AS 'select $1 + $2;'
+ AS 'SELECT $1 + $2;'
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
@@ -740,7 +740,7 @@ $$ LANGUAGE plpgsql;
<para>
Return a record containing multiple output parameters:
<programlisting>
-CREATE FUNCTION dup(in int, out f1 int, out f2 text)
+CREATE FUNCTION dup(IN int, OUT f1 int, OUT f2 text)
AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
LANGUAGE SQL;
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index a157a244e4e..94093599ca2 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -2257,7 +2257,7 @@ CREATE TABLE employees OF employee_type (
Create a range partitioned table:
<programlisting>
CREATE TABLE measurement (
- logdate date not null,
+ logdate date NOT NULL,
peaktemp int,
unitsales int
) PARTITION BY RANGE (logdate);
@@ -2267,7 +2267,7 @@ CREATE TABLE measurement (
Create a range partitioned table with multiple columns in the partition key:
<programlisting>
CREATE TABLE measurement_year_month (
- logdate date not null,
+ logdate date NOT NULL,
peaktemp int,
unitsales int
) PARTITION BY RANGE (EXTRACT(YEAR FROM logdate), EXTRACT(MONTH FROM logdate));
@@ -2277,8 +2277,8 @@ CREATE TABLE measurement_year_month (
Create a list partitioned table:
<programlisting>
CREATE TABLE cities (
- city_id bigserial not null,
- name text not null,
+ city_id bigserial NOT NULL,
+ name text NOT NULL,
population bigint
) PARTITION BY LIST (left(lower(name), 1));
</programlisting></para>
@@ -2287,8 +2287,8 @@ CREATE TABLE cities (
Create a hash partitioned table:
<programlisting>
CREATE TABLE orders (
- order_id bigint not null,
- cust_id bigint not null,
+ order_id bigint NOT NULL,
+ cust_id bigint NOT NULL,
status text
) PARTITION BY HASH (order_id);
</programlisting></para>
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index 928e78cda33..5b155cfa12a 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -372,10 +372,10 @@ PostgreSQL documentation
a role, named <literal>rewind_user</literal> here:
<programlisting>
CREATE USER rewind_user LOGIN;
-GRANT EXECUTE ON function pg_catalog.pg_ls_dir(text, boolean, boolean) TO rewind_user;
-GRANT EXECUTE ON function pg_catalog.pg_stat_file(text, boolean) TO rewind_user;
-GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text) TO rewind_user;
-GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, boolean) TO rewind_user;
+GRANT EXECUTE ON FUNCTION pg_catalog.pg_ls_dir(text, boolean, boolean) TO rewind_user;
+GRANT EXECUTE ON FUNCTION pg_catalog.pg_stat_file(text, boolean) TO rewind_user;
+GRANT EXECUTE ON FUNCTION pg_catalog.pg_read_binary_file(text) TO rewind_user;
+GRANT EXECUTE ON FUNCTION pg_catalog.pg_read_binary_file(text, bigint, bigint, boolean) TO rewind_user;
</programlisting>
</para>
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 7e96a8e1ddb..1ab427d18af 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -2531,7 +2531,7 @@ Tue Oct 26 21:40:57 CEST 1999
statement to be executed. For example, to create an index on each
column of <structname>my_table</structname>:
<programlisting>
-=&gt; <userinput>SELECT format('create index on my_table(%I)', attname)</userinput>
+=&gt; <userinput>SELECT format('CREATE INDEX ON my_table (%I)', attname)</userinput>
-&gt; <userinput>FROM pg_attribute</userinput>
-&gt; <userinput>WHERE attrelid = 'my_table'::regclass AND attnum &gt; 0</userinput>
-&gt; <userinput>ORDER BY attnum</userinput>
@@ -2766,8 +2766,8 @@ hello 10
-- check for the existence of two separate records in the database and store
-- the results in separate psql variables
SELECT
- EXISTS(SELECT 1 FROM customer WHERE customer_id = 123) as is_customer,
- EXISTS(SELECT 1 FROM employee WHERE employee_id = 456) as is_employee
+ EXISTS (SELECT 1 FROM customer WHERE customer_id = 123) AS is_customer,
+ EXISTS (SELECT 1 FROM employee WHERE employee_id = 456) AS is_employee
\gset
\if :is_customer
SELECT * FROM customer WHERE customer_id = 123;
@@ -4023,7 +4023,7 @@ SELECT 1 \bind \sendpipeline
server as soon as it reaches the command-ending semicolon, even if
more input remains on the current line. Thus for example entering
<programlisting>
-select 1; select 2; select 3;
+SELECT 1; SELECT 2; SELECT 3;
</programlisting>
will result in the three SQL commands being individually sent to
the server, with each one's results being displayed before
@@ -4032,7 +4032,7 @@ select 1; select 2; select 3;
command before it and the one after are effectively combined and
sent to the server in one request. So for example
<programlisting>
-select 1\; select 2\; select 3;
+SELECT 1\; SELECT 2\; SELECT 3;
</programlisting>
results in sending the three SQL commands to the server in a single
request, when the non-backslashed semicolon is reached.
@@ -5581,7 +5581,7 @@ PSQL_EDITOR_LINENUMBER_ARG='--line '
input. Notice the changing prompt:
<programlisting>
testdb=&gt; <userinput>CREATE TABLE my_table (</userinput>
-testdb(&gt; <userinput> first integer not null default 0,</userinput>
+testdb(&gt; <userinput> first integer NOT NULL DEFAULT 0,</userinput>
testdb(&gt; <userinput> second text)</userinput>
testdb-&gt; <userinput>;</userinput>
CREATE TABLE
@@ -5770,8 +5770,8 @@ testdb=&gt; <userinput>\crosstabview first second</userinput>
This second example shows a multiplication table with rows sorted in reverse
numerical order and columns with an independent, ascending numerical order.
<programlisting>
-testdb=&gt; <userinput>SELECT t1.first as "A", t2.first+100 AS "B", t1.first*(t2.first+100) as "AxB",</userinput>
-testdb-&gt; <userinput>row_number() over(order by t2.first) AS ord</userinput>
+testdb=&gt; <userinput>SELECT t1.first AS "A", t2.first+100 AS "B", t1.first*(t2.first+100) AS "AxB",</userinput>
+testdb-&gt; <userinput>row_number() OVER (ORDER BY t2.first) AS ord</userinput>
testdb-&gt; <userinput>FROM my_table t1 CROSS JOIN my_table t2 ORDER BY 1 DESC</userinput>
testdb-&gt; <userinput>\crosstabview "A" "B" "AxB" ord</userinput>
A | 101 | 102 | 103 | 104
diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml
index 5a3bcff7607..fd441ef4487 100644
--- a/doc/src/sgml/ref/select.sgml
+++ b/doc/src/sgml/ref/select.sgml
@@ -1927,7 +1927,7 @@ SELECT * FROM unnest(ARRAY['a','b','c','d','e','f']) WITH ORDINALITY;
<programlisting>
WITH t AS (
- SELECT random() as x FROM generate_series(1, 3)
+ SELECT random() AS x FROM generate_series(1, 3)
)
SELECT * FROM t
UNION ALL