Fix a couple of unlogged tables goofs.
"SELECT ... INTO UNLOGGED tabname" works, but wasn't documented; CREATE UNLOGGED SEQUENCE and CREATE UNLOGGED VIEW failed an assertion, instead of throwing a sensible error. Latter issue reported by Itagaki Takahiro; patch review by Tom Lane.
This commit is contained in:
parent
1ab9b012bd
commit
3e6b305d9e
@ -24,7 +24,7 @@ PostgreSQL documentation
|
|||||||
[ WITH [ RECURSIVE ] <replaceable class="parameter">with_query</replaceable> [, ...] ]
|
[ WITH [ RECURSIVE ] <replaceable class="parameter">with_query</replaceable> [, ...] ]
|
||||||
SELECT [ ALL | DISTINCT [ ON ( <replaceable class="parameter">expression</replaceable> [, ...] ) ] ]
|
SELECT [ ALL | DISTINCT [ ON ( <replaceable class="parameter">expression</replaceable> [, ...] ) ] ]
|
||||||
* | <replaceable class="parameter">expression</replaceable> [ [ AS ] <replaceable class="parameter">output_name</replaceable> ] [, ...]
|
* | <replaceable class="parameter">expression</replaceable> [ [ AS ] <replaceable class="parameter">output_name</replaceable> ] [, ...]
|
||||||
INTO [ TEMPORARY | TEMP ] [ TABLE ] <replaceable class="parameter">new_table</replaceable>
|
INTO [ TEMPORARY | TEMP | UNLOGGED ] [ TABLE ] <replaceable class="parameter">new_table</replaceable>
|
||||||
[ FROM <replaceable class="parameter">from_item</replaceable> [, ...] ]
|
[ FROM <replaceable class="parameter">from_item</replaceable> [, ...] ]
|
||||||
[ WHERE <replaceable class="parameter">condition</replaceable> ]
|
[ WHERE <replaceable class="parameter">condition</replaceable> ]
|
||||||
[ GROUP BY <replaceable class="parameter">expression</replaceable> [, ...] ]
|
[ GROUP BY <replaceable class="parameter">expression</replaceable> [, ...] ]
|
||||||
@ -65,6 +65,16 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="parameter">expression</replac
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>UNLOGGED</literal></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If specified, the table is created as an unlogged table. Refer
|
||||||
|
to <xref linkend="sql-createtable"> for details.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><replaceable class="PARAMETER">new_table</replaceable></term>
|
<term><replaceable class="PARAMETER">new_table</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@ -119,6 +119,12 @@ DefineSequence(CreateSeqStmt *seq)
|
|||||||
int i;
|
int i;
|
||||||
NameData name;
|
NameData name;
|
||||||
|
|
||||||
|
/* Unlogged sequences are not implemented -- not clear if useful. */
|
||||||
|
if (seq->sequence->relpersistence == RELPERSISTENCE_UNLOGGED)
|
||||||
|
ereport(ERROR,
|
||||||
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
|
errmsg("unlogged sequences are not supported")));
|
||||||
|
|
||||||
/* Check and set all option values */
|
/* Check and set all option values */
|
||||||
init_params(seq->options, true, &new, &owned_by);
|
init_params(seq->options, true, &new, &owned_by);
|
||||||
|
|
||||||
|
@ -465,6 +465,12 @@ DefineView(ViewStmt *stmt, const char *queryString)
|
|||||||
view->relname)));
|
view->relname)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Unlogged views are not sensible. */
|
||||||
|
if (view->relpersistence == RELPERSISTENCE_UNLOGGED)
|
||||||
|
ereport(ERROR,
|
||||||
|
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||||
|
errmsg("views cannot be unlogged because they do not have storage")));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the view relation
|
* Create the view relation
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user