Обсуждение: lost in system tables

Поиск
Список
Период
Сортировка

lost in system tables

От
Emil Rachovsky
Дата:
 I am trying to find the equivalent of these two
Sybase system columns :

check_on_commit (Y/N)  -  Indicates whether INSERT and
UPDATE commands should wait until the next COMMIT
command to check if foreign keys are valid. A foreign
key is valid if, for each row in the foreign table,
the values in the columns of the foreign key either
contain the NULL value or match the primary key values
in some row of the primary table.

nulls (Y/N)  -  Indicates whether the columns in the
foreign key are allowed to contain the NULL value.
Note that this setting is independent of the nulls
setting in the columns contained in the foreign key.

 Maybe pg_constaint.condeferrable is appropriate for
check_on_commit? I'll appreciate any help

Thanks in advance,
Emil





__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com


Re: [GENERAL] lost in system tables

От
Luca Pireddu
Дата:
On Tuesday 06 December 2005 08:47, Emil Rachovsky wrote:
>  I am trying to find the equivalent of these two
> Sybase system columns :
>
> check_on_commit (Y/N)  -  Indicates whether INSERT and
> UPDATE commands should wait until the next COMMIT
> command to check if foreign keys are valid. A foreign
> key is valid if, for each row in the foreign table,
> the values in the columns of the foreign key either
> contain the NULL value or match the primary key values
> in some row of the primary table.
>
> nulls (Y/N)  -  Indicates whether the columns in the
> foreign key are allowed to contain the NULL value.
> Note that this setting is independent of the nulls
> setting in the columns contained in the foreign key.
>
>  Maybe pg_constaint.condeferrable is appropriate for
> check_on_commit? I'll appreciate any help
>
> Thanks in advance,
> Emil

Those parameters are specified when you declare the foreign key.  Look here,
in the section describing "references":
http://www.postgresql.org/docs/8.1/interactive/sql-createtable.html

Luca

Re: lost in system tables

От
Tom Lane
Дата:
Emil Rachovsky <zsevgymko@yahoo.com> writes:
>  I am trying to find the equivalent of these two
> Sybase system columns :

> check_on_commit (Y/N)  -  Indicates whether INSERT and
> UPDATE commands should wait until the next COMMIT
> command to check if foreign keys are valid.

I think you are looking for the DEFERRABLE/DEFERRED option of foreign
key constraints.

> nulls (Y/N)  -  Indicates whether the columns in the
> foreign key are allowed to contain the NULL value.
> Note that this setting is independent of the nulls
> setting in the columns contained in the foreign key.

No such animal in the SQL standard --- though perhaps MATCH FULL
is approximately what you are looking for?  Your description as
stated makes no sense at all; either the columns are allowed to
be null, or they're not.

            regards, tom lane

Re: lost in system tables

От
Emil Rachovsky
Дата:
 Thank you,Tom,
As for the description of 'nulls' I have taken it as
it is from the Sybase help file :)





__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com


Re: [GENERAL] lost in system tables

От
Emil Rachovsky
Дата:
> Those parameters are specified when you declare the
> foreign key.  Look here,
> in the section describing "references":
>
http://www.postgresql.org/docs/8.1/interactive/sql-createtable.html
>
> Luca

Thank you,Luca
I know that these parameters are specified when you
declare the foreign key, but i need to check them out
later from the system tables. The first one must be
something like the 'deferrable' column in
pg_constaint, but the second is still in vague.

Emil



__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com