From 49d43faa835f3c6817be9fc0b98bec0d661c2587 Mon Sep 17 00:00:00 2001 From: David Rowley Date: Thu, 6 Nov 2025 16:03:02 +1300 Subject: Doc: use uppercase keywords in SQLs Use uppercase SQL keywords consistently throughout the documentation to ease reading. Also add whitespace in a couple of places where it improves readability. Author: Erik Wienhold Reviewed-by: David Rowley Discussion: https://postgr.es/m/82eb512b-8ed2-46be-b311-54ffd26978c4%40ewie.name --- doc/src/sgml/ref/psql-ref.sgml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'doc/src/sgml/ref/psql-ref.sgml') 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 my_table: -=> SELECT format('create index on my_table(%I)', attname) +=> SELECT format('CREATE INDEX ON my_table (%I)', attname) -> FROM pg_attribute -> WHERE attrelid = 'my_table'::regclass AND attnum > 0 -> ORDER BY attnum @@ -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 -select 1; select 2; select 3; +SELECT 1; SELECT 2; SELECT 3; 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 -select 1\; select 2\; select 3; +SELECT 1\; SELECT 2\; SELECT 3; 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: testdb=> CREATE TABLE my_table ( -testdb(> first integer not null default 0, +testdb(> first integer NOT NULL DEFAULT 0, testdb(> second text) testdb-> ; CREATE TABLE @@ -5770,8 +5770,8 @@ testdb=> \crosstabview first second This second example shows a multiplication table with rows sorted in reverse numerical order and columns with an independent, ascending numerical order. -testdb=> SELECT t1.first as "A", t2.first+100 AS "B", t1.first*(t2.first+100) as "AxB", -testdb-> row_number() over(order by t2.first) AS ord +testdb=> SELECT t1.first AS "A", t2.first+100 AS "B", t1.first*(t2.first+100) AS "AxB", +testdb-> row_number() OVER (ORDER BY t2.first) AS ord testdb-> FROM my_table t1 CROSS JOIN my_table t2 ORDER BY 1 DESC testdb-> \crosstabview "A" "B" "AxB" ord A | 101 | 102 | 103 | 104 -- cgit v1.2.3