Re: [GENERAL] disjoint union types

2007-10-12 Thread Sam Mason
On Wed, Oct 10, 2007 at 12:10:10PM -0500, Erik Jones wrote: > On Oct 10, 2007, at 11:42 AM, Sam Mason wrote: >> On Wed, Oct 10, 2007 at 05:02:36PM +0100, Ian Barber wrote: >>> CREATE TABLE shapes ( >>> shape_id serial PRIMARY KEY, >>> area real not null >>> ); >>> >>> CREATE TABLE circle ( >>> r

Re: [GENERAL] disjoint union types

2007-10-10 Thread Erik Jones
On Oct 10, 2007, at 11:42 AM, Sam Mason wrote: On Wed, Oct 10, 2007 at 05:02:36PM +0100, Ian Barber wrote: I wonder if the best way to go would be to use the OO stuff. I don't see how the following is object orientated, but I'm not sure it matters much. If you had a "shapes" table, that

Re: [GENERAL] disjoint union types

2007-10-10 Thread Sam Mason
On Wed, Oct 10, 2007 at 05:02:36PM +0100, Ian Barber wrote: > I wonder if the best way to go would be to use the OO stuff. I don't see how the following is object orientated, but I'm not sure it matters much. > If you had a "shapes" table, that had the various operations you were > interested in

Re: [GENERAL] disjoint union types

2007-10-10 Thread Ian Barber
On 10/10/07, Sam Mason <[EMAIL PROTECTED]> wrote: > > On Tue, Oct 09, 2007 at 10:30:15AM -0500, Erik Jones wrote: > >On Oct 9, 2007, at 9:38 AM, Sam Mason wrote: > >> CREATE TABLE circle ( id SERIAL PRIMARY KEY, radius REAL NOT NULL ); > >> CREATE TABLE square ( id SERIAL PRIMARY KEY, sidelen

Re: [GENERAL] disjoint union types

2007-10-10 Thread Sam Mason
On Tue, Oct 09, 2007 at 10:30:15AM -0500, Erik Jones wrote: >On Oct 9, 2007, at 9:38 AM, Sam Mason wrote: >> CREATE TABLE circle ( id SERIAL PRIMARY KEY, radius REAL NOT NULL ); >> CREATE TABLE square ( id SERIAL PRIMARY KEY, sidelen REAL NOT NULL ); >> >> CREATE TABLE shapes ( >> id SER

Re: [GENERAL] disjoint union types

2007-10-09 Thread Erik Jones
On Oct 9, 2007, at 9:38 AM, Sam Mason wrote: Hi, I was after opinions as to the best way to lay tables out to get the effect of a "disjoint union" type (also known as a "tagged union"). When I have to do this at the moment, I'm creating a structure like: CREATE TABLE circle ( id SERIAL PRIMA

[GENERAL] disjoint union types

2007-10-09 Thread Sam Mason
Hi, I was after opinions as to the best way to lay tables out to get the effect of a "disjoint union" type (also known as a "tagged union"). When I have to do this at the moment, I'm creating a structure like: CREATE TABLE circle ( id SERIAL PRIMARY KEY, radius REAL NOT NULL ); CREATE TABLE