"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.
[ WITH [ RECURSIVE ] with_query [, ...] ]
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
* | expression [ [ AS ] output_name ] [, ...]
- INTO [ TEMPORARY | TEMP ] [ TABLE ] new_table
+ INTO [ TEMPORARY | TEMP | UNLOGGED ] [ TABLE ] new_table
[ FROM from_item [, ...] ]
[ WHERE condition ]
[ GROUP BY expression [, ...] ]
+
+ UNLOGGED
+
+ If specified, the table is created as an unlogged table. Refer
+ to for details.
+
+
+
+
new_table
int i;
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 */
init_params(seq->options, true, &new, &owned_by);
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
*