mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-17 02:13:24 +02:00
works with a new policy in cascade mode . Please Read README.MAX . I do not know if you are the author of refint.c , but if not please tell me who is . Thank you ( excuse me for my bad english) . Massimo Lambertini massimo.lambertini@everex.it
38 lines
943 B
SQL
38 lines
943 B
SQL
-- Note the syntax is strict because i have no time to write better perl filter.
|
|
--
|
|
-- [blank] is 1 blank
|
|
-- at the end of an interesting line must be a [,] or [--]
|
|
-- [ending] must be a , or --
|
|
--
|
|
-- foreign[blank]key[blank]([blank]keyname,..,keyname[blank])[blank]references[blank]table[blank][ending]
|
|
--
|
|
-- step1.e < example.sql | step2.pl > foreign_key_triggers.sql
|
|
--
|
|
-- step1.e is a simple program that UPPERCASE ALL . I know that is simple implementing in Perl
|
|
-- bu i haven't time
|
|
|
|
|
|
CREATE TABLE
|
|
gruppo
|
|
(
|
|
codice_gruppo int4 NOT NULL,
|
|
descrizione varchar(32) NOT NULL
|
|
primary key ( codice_gruppo )
|
|
|
|
) ;
|
|
|
|
--
|
|
-- fa_parte : Appartenenza di una Azienda Conatto o Cliente ad un certo GRUPPO
|
|
--
|
|
|
|
CREATE TABLE
|
|
fa_parte
|
|
(
|
|
codice_gruppo int4 NOT NULL,
|
|
codice_contatto int4 NOT NULL,
|
|
|
|
primary key ( codice_gruppo,codice_contatto ) ,
|
|
foreign key ( codice_gruppo ) references gruppo --
|
|
);
|
|
|