create_variable.sgml.20210108.diff
text/x-diff
Filename: create_variable.sgml.20210108.diff
Type: text/x-diff
Part: 0
Message:
Re: proposal: schema variables
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| doc/src/sgml/ref/create_variable.sgml | 18 | 18 |
--- doc/src/sgml/ref/create_variable.sgml.orig 2021-01-08 17:40:20.181823036 +0100
+++ doc/src/sgml/ref/create_variable.sgml 2021-01-08 17:59:46.976127524 +0100
@@ -16,7 +16,7 @@
<refnamediv>
<refname>CREATE VARIABLE</refname>
- <refpurpose>define a new permissioned typed schema variable</refpurpose>
+ <refpurpose>define a schema variable</refpurpose>
</refnamediv>
<refsynopsisdiv>
@@ -29,24 +29,24 @@
<title>Description</title>
<para>
- The <command>CREATE VARIABLE</command> command creates a new schema variable.
+ The <command>CREATE VARIABLE</command> command creates a schema variable.
Schema variables, like relations, exist within a schema and their access is
controlled via <command>GRANT</command> and <command>REVOKE</command> commands.
- Their changes are non-transactional by default.
+ Changing a schema variable is non-transactional by default.
</para>
<para>
The value of a schema variable is local to the current session. Retrieving
a variable's value returns either a NULL or a default value, unless its value
is set to something else in the current session with a LET command. By default,
- the content of variable is not transactional, alike regular variables in PL languages.
+ the content of a variable is not transactional. This is the same as in regular variables in PL languages.
</para>
<para>
- Schema variables are retrieved by the regular <command>SELECT</command> SQL command.
- Their value can be set with the <command>LET</command> SQL command.
- Notably, while schema variables share properties with tables, they cannot be updated
- with <command>UPDATE</command> commands.
+ Schema variables are retrieved by the <command>SELECT</command> SQL command.
+ Their value is set with the <command>LET</command> SQL command.
+ While schema variables share properties with tables, their value cannot be updated
+ with an <command>UPDATE</command> command.
</para>
</refsect1>
@@ -76,7 +76,7 @@
<term><replaceable class="parameter">name</replaceable></term>
<listitem>
<para>
- The name (optionally schema-qualified) of the variable to create.
+ The name, optionally schema-qualified, of the variable.
</para>
</listitem>
</varlistentry>
@@ -85,7 +85,7 @@
<term><replaceable class="parameter">data_type</replaceable></term>
<listitem>
<para>
- The name (optionally schema-qualified) of the data type of the variable to be created.
+ The name, optionally schema-qualified, of the data type of the variable.
</para>
</listitem>
</varlistentry>
@@ -105,7 +105,7 @@
<term><literal>NOT NULL</literal></term>
<listitem>
<para>
- The <literal>NOT NULL</literal> clause forbid to set the variable to
+ The <literal>NOT NULL</literal> clause forbids to set the variable to
a null value. A variable created as NOT NULL and without an explicitly
declared default value cannot be read until it is initialized by a LET
command. This obliges the user to explicitly initialize the variable
@@ -118,22 +118,22 @@
<term><literal>DEFAULT <replaceable>default_expr</replaceable></literal></term>
<listitem>
<para>
- The <literal>DEFAULT</literal> clause assigns a default data to
- schema variable.
+ The <literal>DEFAULT</literal> clause can be used to assign a default value to
+ a schema variable.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><literal>ON COMMIT DROP</literal>, <literal>ON TRANSACTIONAL END RESET</literal></term>
+ <term><literal>ON COMMIT DROP</literal>, <literal>ON TRANSACTION END RESET</literal></term>
<listitem>
<para>
The <literal>ON COMMIT DROP</literal> clause specifies the behaviour
- of temporary schema variable at transaction commit. With this clause the
+ of a temporary schema variable at transaction commit. With this clause the
variable is dropped at commit time. The clause is only allowed
- for temporary variables. The <literal>ON TRANSACTIONAL END RESET</literal>
+ for temporary variables. The <literal>ON TRANSACTION END RESET</literal>
clause enforces the variable to be reset to its default value when
- the transaction is either commited or rolled back.
+ the transaction is committed or rolled back.
</para>
</listitem>
</varlistentry>
@@ -145,7 +145,7 @@
<title>Notes</title>
<para>
- Use <command>DROP VARIABLE</command> command to remove a variable.
+ Use the <command>DROP VARIABLE</command> command to remove a variable.
</para>
</refsect1>