lost in system tables

Started by Emil Rachovskyover 20 years ago5 messagesgeneral
Jump to latest
#1Emil Rachovsky
zsevgymko@yahoo.com

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

#2Luca Pireddu
luca@cs.ualberta.ca
In reply to: Emil Rachovsky (#1)
Re: lost in system tables

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Emil Rachovsky (#1)
Re: [SQL] lost in system tables

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

#4Emil Rachovsky
zsevgymko@yahoo.com
In reply to: Tom Lane (#3)
Re: [SQL] lost in system tables

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

#5Emil Rachovsky
zsevgymko@yahoo.com
In reply to: Luca Pireddu (#2)
Re: [SQL] lost in system tables

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