pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
quastions about primary key
5+ messages / 4 participants
[nested] [flat]

* quastions about primary key
@ 2003-01-24 06:44 jack <datactrl@tpg.com.au>
  2003-01-24 10:04 ` Re: quastions about primary key Tomasz Myrta <jasiek@klaster.net>
  2003-01-24 15:14 ` Re: quastions about primary key Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 2 replies; 5+ messages in thread

From: jack @ 2003-01-24 06:44 UTC (permalink / raw)
  To: pgsql-sql

Is that possible to have a two columns primary key on a table with null
value on second column?

Jack




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: quastions about primary key
  2003-01-24 06:44 quastions about primary key jack <datactrl@tpg.com.au>
@ 2003-01-24 10:04 ` Tomasz Myrta <jasiek@klaster.net>
  1 sibling, 0 replies; 5+ messages in thread

From: Tomasz Myrta @ 2003-01-24 10:04 UTC (permalink / raw)
  To: jack <datactrl@tpg.com.au>; +Cc: pgsql-sql

jack wrote:
> Is that possible to have a two columns primary key on a table with null
> value on second column?
> 
> Jack
Probably not, because (1,2,null,null) is unique for postresql.
Watch discussion on mailing list
about unique indexes (on which primary key is based) several days ago.

Regards,
Tomasz Myrta




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: quastions about primary key
  2003-01-24 06:44 quastions about primary key jack <datactrl@tpg.com.au>
@ 2003-01-24 15:14 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2003-01-26 02:29   ` Re: quastions about primary key jack <datactrl@tpg.com.au>
  1 sibling, 1 reply; 5+ messages in thread

From: Stephan Szabo @ 2003-01-24 15:14 UTC (permalink / raw)
  To: jack <datactrl@tpg.com.au>; +Cc: pgsql-sql

On Fri, 24 Jan 2003, jack wrote:

> Is that possible to have a two columns primary key on a table with null
> value on second column?

No, because primary key implies not null on all columns involved
(technically I think it's that a non-deferrable primary key implies
not null on all columns involved, but we don't support deferrable ones)





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: quastions about primary key
  2003-01-24 06:44 quastions about primary key jack <datactrl@tpg.com.au>
  2003-01-24 15:14 ` Re: quastions about primary key Stephan Szabo <sszabo@megazone23.bigpanda.com>
@ 2003-01-26 02:29   ` jack <datactrl@tpg.com.au>
  2003-01-26 04:23     ` Re: quastions about primary key Bruno Wolff III <bruno@wolff.to>
  0 siblings, 1 reply; 5+ messages in thread

From: jack @ 2003-01-26 02:29 UTC (permalink / raw)
  To: pgsql-sql


I try use uique instead of primary key. And it works, it allows null values.
Is there any other difference between primary key and unique?

Jack
----- Original Message -----
From: "Stephan Szabo" <sszabo@megazone23.bigpanda.com>
To: "jack" <datactrl@tpg.com.au>
Cc: <pgsql-sql@postgresql.org>
Sent: Saturday, January 25, 2003 1:14 AM
Subject: Re: [SQL] quastions about primary key


> On Fri, 24 Jan 2003, jack wrote:
>
> > Is that possible to have a two columns primary key on a table with null
> > value on second column?
>
> No, because primary key implies not null on all columns involved
> (technically I think it's that a non-deferrable primary key implies
> not null on all columns involved, but we don't support deferrable ones)
>
>




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: quastions about primary key
  2003-01-24 06:44 quastions about primary key jack <datactrl@tpg.com.au>
  2003-01-24 15:14 ` Re: quastions about primary key Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2003-01-26 02:29   ` Re: quastions about primary key jack <datactrl@tpg.com.au>
@ 2003-01-26 04:23     ` Bruno Wolff III <bruno@wolff.to>
  0 siblings, 0 replies; 5+ messages in thread

From: Bruno Wolff III @ 2003-01-26 04:23 UTC (permalink / raw)
  To: jack <datactrl@tpg.com.au>; +Cc: pgsql-sql

On Sun, Jan 26, 2003 at 12:29:12 +1000,
  jack <datactrl@tpg.com.au> wrote:
> 
> I try use uique instead of primary key. And it works, it allows null values.
> Is there any other difference between primary key and unique?

I believe that the primary key is the default key for foreign key references
into a table.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-01-26 04:23 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24 06:44 quastions about primary key jack <datactrl@tpg.com.au>
2003-01-24 10:04 ` Tomasz Myrta <jasiek@klaster.net>
2003-01-24 15:14 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2003-01-26 02:29   ` jack <datactrl@tpg.com.au>
2003-01-26 04:23     ` Bruno Wolff III <bruno@wolff.to>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox