Re: Be more clear what names can be used for tables with "CREATE TABLE"?

Daniel Westermann (DWE) <daniel.westermann@dbi-services.com>

From: "Daniel Westermann (DWE)" <daniel.westermann@dbi-services.com>
To: Jürgen Purtz <juergen@purtz.de>, "pgsql-docs@lists.postgresql.org" <pgsql-docs@lists.postgresql.org>
Date: 2021-10-31T19:48:15Z
Lists: pgsql-docs
>a) Don't forget: constraint, function, procedure, trigger.

Functions don't count:

postgres=# create function f() returns int as $$ select 1; $$ language sql;
CREATE FUNCTION
postgres=# create table f ( a int );
CREATE TABLE

Procedures and constraints don't count:
postgres=# create procedure p() as $$ declare a int; begin a = 1; end; $$ language plpgsql;
CREATE PROCEDURE
postgres=# create table p ( a int );
CREATE TABLE
postgres=# alter table p add constraint c check ( a > 1 );
ALTER TABLE
postgres=# create table c ( a int );
CREATE TABLE

>b) The hint applies to each of such objects: CREATE [TABLE|VIEW|FUNCTION|...]. To avoid such redundancy we could extend and clarify the definition of 'SQL object / local object / global object' within the glossary and refer to it.

+1

Regards
Daniel




Commits

  1. Doc: be more precise about conflicts between relation names.