final class ObjectForms
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

Tells which object name forms each generic object command writes for each object kind.

Rule: PG-OBJECT-FORM-001. Scope: DropStmt, RemoveFuncStmt, RemoveAggrStmt, RemoveOperStmt, DropOpClassStmt, DropOpFamilyStmt, CommentStmt, SecLabelStmt, RenameStmt, AlterObjectSchemaStmt, AlterOwnerStmt, AlterObjectDependsStmt and the DROP CAST and DROP TRANSFORM forms of the catalog family. The grammar fixes, per command and object kind, how the object is named: a dotted name of any length, a single name, a name within a table or domain, a type name, a routine, aggregate or operator signature, a name with an access method, a cast, a transform, a large-object number or a relation name. A constructor accepts exactly the pairs these tables list, so every command it builds can be written back. Source: the synopses of https://www.postgresql.org/docs/17/sql-commands.html. Status: Implemented.

Constants§

public const ANY_NAME = ['TABLE', 'SEQUENCE', 'VIEW', 'MATERIALIZED VIEW', 'INDEX', 'FOREIGN TABLE', 'C…

The kinds object_type_any_name writes with a dotted name.

public const DROP_NAME = ['ACCESS METHOD', 'EVENT TRIGGER', 'EXTENSION', 'FOREIGN DATA WRAPPER', 'LANGUA…

The kinds drop_type_name writes with a single name.

public const GLOBAL_NAME = ['DATABASE', 'ROLE', 'SUBSCRIPTION', 'TABLESPACE']

The kinds object_type_name adds to drop_type_name.

public const MEMBER = ['POLICY', 'RULE', 'TRIGGER']

The kinds named within a table: object_type_name_on_any_name.

public const ROUTINE = ['FUNCTION', 'PROCEDURE', 'ROUTINE']

The routine kinds written with function_with_argtypes.

public const SINGLE_DROP = ['POLICY', 'RULE', 'TRIGGER', 'OPERATOR CLASS', 'OPERATOR FAMILY', 'CAST', 'TRA…

The kinds DROP removes one object of at a time.

public const RELATION = ['TABLE', 'VIEW', 'MATERIALIZED VIEW', 'FOREIGN TABLE']

The kinds whose objects are relations the context can declare: a command naming one resolves it.

public const ALTERED_RELATION = ['TABLE', 'FOREIGN TABLE', 'SEQUENCE', 'VIEW', 'MATERIALIZED VIEW', 'INDEX']

The kinds ALTER ... RENAME, SET SCHEMA and DEPENDS ON EXTENSION write with a relation name; TABLE and FOREIGN TABLE accept ONLY.

Methods§

public function drop(ObjectKind $kind): list<string>
public function alteredRest(ObjectKind $kind, string $command): list<string>

Answers the forms of the relation, operator, member and large-object kinds of ALTER ... RENAME, SET SCHEMA and OWNER TO.

Parameters

$kindObjectKind
$commandstring`rename`, `schema` or `owner`

Returns

list<string>
Test cases 1
Called from 1
Calls 8
public function depends(ObjectKind $kind): list<string>

Test cases 8§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 8

Relations§

Instantiated in 7
Method calls 14
Constant reads 4