PostgreSQL

Скачать в pdf «PostgreSQL»


Column Constraint definition:


[ CONSTRAINT name ] PRIMARY KEY [ { INITIALLY DEFERRED | INITIALLY IMMEDIATE} ] [ [ NOT ] DEFERRABLE ]

d.22 CREATE TABLE AS


Name


CREATE TABLE AS — Creates a new table


CREATE TABLE table [ (column [,…] ) ] AS select_elause


Inputs


table The name of a new table to be created.


column The name of a column. Multiple column names can be specified using a comma-delimited list of column names.


select_clause A valid query statement. Refer to SELECT for a description of the allowed syntax. Outputs


Refer to CREATE TABLE and SELECT for a summary of possible output messages. Description


CREATE TABLE AS enables a table to be created from the contents of an existing table. It is functionality equivalent to SELECT INTO, but with perhaps a more direct syntax.

d.23 create trigger


Name


CREATE TRIGGER — Creates a new trigger


CREATE TRIGGER name { BEFORE | AFTER } { event [OR …] }


ON table


FOR EACH { ROW | STATEMENT }


EXECUTE PROCEDURE func (arguments )


Inputs


name The name of an existing trigger. table The name of a table. event One of INSERT, DELETE or UPDATE. funcname A user-supplied function.


Outputs


CREATE This message is returned if the trigger is successfully created.


Description


CREATE TRIGGER will enter a new trigger into the current data base. The trigger will be associated with the relation relname and will execute the specified function funcname.

Скачать в pdf «PostgreSQL»