summaryrefslogtreecommitdiffstats
path: root/src/backend/catalog/pg_class.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:46:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:46:48 +0000
commit311bcfc6b3acdd6fd152798c7f287ddf74fa2a98 (patch)
tree0ec307299b1dada3701e42f4ca6eda57d708261e /src/backend/catalog/pg_class.c
parentInitial commit. (diff)
downloadpostgresql-15-upstream.tar.xz
postgresql-15-upstream.zip
Adding upstream version 15.4.upstream/15.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/backend/catalog/pg_class.c')
-rw-r--r--src/backend/catalog/pg_class.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/backend/catalog/pg_class.c b/src/backend/catalog/pg_class.c
new file mode 100644
index 0000000..b696fa2
--- /dev/null
+++ b/src/backend/catalog/pg_class.c
@@ -0,0 +1,52 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_class.c
+ * routines to support manipulation of the pg_class relation
+ *
+ * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ * src/backend/catalog/pg_class.c
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "postgres.h"
+
+#include "catalog/pg_class.h"
+
+/*
+ * Issue an errdetail() informing that the relkind is not supported for this
+ * operation.
+ */
+int
+errdetail_relkind_not_supported(char relkind)
+{
+ switch (relkind)
+ {
+ case RELKIND_RELATION:
+ return errdetail("This operation is not supported for tables.");
+ case RELKIND_INDEX:
+ return errdetail("This operation is not supported for indexes.");
+ case RELKIND_SEQUENCE:
+ return errdetail("This operation is not supported for sequences.");
+ case RELKIND_TOASTVALUE:
+ return errdetail("This operation is not supported for TOAST tables.");
+ case RELKIND_VIEW:
+ return errdetail("This operation is not supported for views.");
+ case RELKIND_MATVIEW:
+ return errdetail("This operation is not supported for materialized views.");
+ case RELKIND_COMPOSITE_TYPE:
+ return errdetail("This operation is not supported for composite types.");
+ case RELKIND_FOREIGN_TABLE:
+ return errdetail("This operation is not supported for foreign tables.");
+ case RELKIND_PARTITIONED_TABLE:
+ return errdetail("This operation is not supported for partitioned tables.");
+ case RELKIND_PARTITIONED_INDEX:
+ return errdetail("This operation is not supported for partitioned indexes.");
+ default:
+ elog(ERROR, "unrecognized relkind: '%c'", relkind);
+ return 0;
+ }
+}