We can just say "... is not a sequence" instead of the more
complicated variant from before, which was probably copied from
src/backend/access/table/table.c.
Fix a typo in a comment in passing.
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/
6d3fef19-a420-4e11-8235-
8ea534bf2080%40eisentraut.org
/* ----------------
* validate_relation_kind - check the relation's kind
*
- * Make sure relkind is from a sequence.
+ * Make sure relkind is a sequence.
* ----------------
*/
static inline void
if (r->rd_rel->relkind != RELKIND_SEQUENCE)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("cannot open relation \"%s\"",
- RelationGetRelationName(r)),
- errdetail_relkind_not_supported(r->rd_rel->relkind)));
+ errmsg("\"%s\" is not a sequence",
+ RelationGetRelationName(r))));
}
INCREMENT BY 4 MAXVALUE 36 MINVALUE 5 CYCLE;
NOTICE: relation "sequence_test2" does not exist, skipping
ALTER SEQUENCE serialTest1 CYCLE; -- error, not a sequence
-ERROR: cannot open relation "serialtest1"
-DETAIL: This operation is not supported for tables.
+ERROR: "serialtest1" is not a sequence
CREATE SEQUENCE sequence_test2 START WITH 32;
CREATE SEQUENCE sequence_test4 INCREMENT BY -1;
SELECT nextval('sequence_test2');