support foreign key

This commit is contained in:
yupeng
2020-11-05 21:29:47 +08:00
parent bc0e59efb3
commit c527645624
3 changed files with 10 additions and 4 deletions

View File

@ -80,7 +80,9 @@ where table_constraint can be:
{ CHECK ( expression ) | { CHECK ( expression ) |
UNIQUE ( column_name [, ... ] ) index_parameters | UNIQUE ( column_name [, ... ] ) index_parameters |
PRIMARY KEY ( column_name [, ... ] ) index_parameters | PRIMARY KEY ( column_name [, ... ] ) index_parameters |
PARTIAL CLUSTER KEY ( column_name [, ... ] ) } PARTIAL CLUSTER KEY ( column_name [, ... ] ) |
FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ]
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] }
[ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ] [ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
where index_parameters can be: where index_parameters can be:
[ WITH ( {storage_parameter = value} [, ... ] ) ] [ WITH ( {storage_parameter = value} [, ... ] ) ]

View File

@ -35,7 +35,9 @@ where table_constraint can be:
{ CHECK ( expression ) | { CHECK ( expression ) |
UNIQUE ( column_name [, ... ] ) index_parameters | UNIQUE ( column_name [, ... ] ) index_parameters |
PRIMARY KEY ( column_name [, ... ] ) index_parameters | PRIMARY KEY ( column_name [, ... ] ) index_parameters |
PARTIAL CLUSTER KEY ( column_name [, ... ] ) } PARTIAL CLUSTER KEY ( column_name [, ... ] ) |
FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ]
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] }
[ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ] [ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
where compress_mode can be: where compress_mode can be:
{ DELTA | PREFIX | DICTIONARY | NUMSTR | NOCOMPRESS } { DELTA | PREFIX | DICTIONARY | NUMSTR | NOCOMPRESS }
@ -46,4 +48,4 @@ where index_parameters can be:
[ USING INDEX TABLESPACE tablespace_name ] [ USING INDEX TABLESPACE tablespace_name ]
</synopsis> </synopsis>
</refsynopsisdiv> </refsynopsisdiv>
</refentry> </refentry>

View File

@ -40,7 +40,9 @@ where table_constraint can be:
[ CONSTRAINT constraint_name ] [ CONSTRAINT constraint_name ]
{ CHECK ( expression ) | { CHECK ( expression ) |
UNIQUE ( column_name [, ... ] ) index_parameters | UNIQUE ( column_name [, ... ] ) index_parameters |
PRIMARY KEY ( column_name [, ... ] ) index_parameters} PRIMARY KEY ( column_name [, ... ] ) index_parameters |
FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ]
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] }
[ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ] [ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
where index_parameters can be: where index_parameters can be:
[ WITH ( {storage_parameter = value} [, ... ] ) ] [ WITH ( {storage_parameter = value} [, ... ] ) ]