Search Postgresql Archives

Re: brain-teaser with CONSTRAINT - any SQL experts?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Uwe said:
> how about using 2 tables with according unique/primary key constraints and a
> view to actually access the data (mixing the 2 tables into one) ?

Oliver said:
> Create a separate table with the two columns name and isbn which are
> that table's primary key; on the main table, create a foreign key to the
> new table

But my original email said:
> > I know it's tempting to say, "just link a separate table for the book
> > and don't store the book name" but let's just pretend that's not an
> > option


For reasons not worth going into, creating a separate table for the
code and name is not an option.  It has to be a self-contained
restriction inside this table.

Perhaps there's another way, using triggers or something?

Any other ideas?

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux