Re: [SQL] Problem with SET CONSTRAINTS ALL DEFERRED;

2006-05-19 Thread Stephan Szabo
On Fri, 19 May 2006, Kaloyan Iliev wrote: > Hi Friends, > > I am trying to postpone the foreign key constraint check till the end of > transaction but it doesn't work. > Can anyone help me with a tip what I am doing wrong. Was the constraint created as deferrable (which is not the default)? ALL D

[SQL] Problem with SET CONSTRAINTS ALL DEFERRED;

2006-05-19 Thread Kaloyan Iliev
Hi Friends, I am trying to postpone the foreign key constraint check till the end of transaction but it doesn't work. Can anyone help me with a tip what I am doing wrong. Thanks in advance. Kaloyan Iliev test=# BEGIN; BEGIN test=# test=# SET CONSTRAINTS ALL DEFERRED; SET CONSTRAINTS test=#

Re: [SQL] usernames of a group from SQL

2006-05-19 Thread Achilleus Mantzios
O Kis Jαnos Tamαs έγραψε στις May 19, 2006 : > Hi, > > At the first time: I'm in newbie in SQL... I'm sorry! > > My question is: How can I get the usernames of a group (for example > 'osztatlan_users') from SQL? > > I try it: > > SELECT usename > FROM pg_user > WHERE usesysid IN (SELECT groli

[SQL] usernames of a group from SQL

2006-05-19 Thread Kis János Tamás
Hi, At the first time: I'm in newbie in SQL... I'm sorry! My question is: How can I get the usernames of a group (for example 'osztatlan_users') from SQL? I try it: SELECT usename FROM pg_user WHERE usesysid IN (SELECT grolist FROM pg_group WHERE groname='osztatlan_users') ORDER BY pg_user;

Re: [SQL] Constraint question

2006-05-19 Thread Markus Schaber
Hi, Andreas, Andreas Joseph Krogh wrote: >>CREATE UNIQUE INDEX foo ON onp_crm_businessfield_company(company_id) >>WHERE is_prefferred; > I also figured out that an index like this also works: > UNIQUE(company_id, is_preferred) > This works because NULL = NULL is false. But I guess your solution

Re: [SQL] Constraint question

2006-05-19 Thread Andreas Joseph Krogh
On Thursday 18 May 2006 18:38, Markus Schaber wrote: > Hi, Andreas, > > Andreas Joseph Krogh wrote: > > create table onp_crm_businessfield_company( > > businessfield_id integer not null references onp_crm_businessfield(id), > > company_id integer not null references onp_crm_relation(id), > > is_pre