Re: [GENERAL] composite type and domain

2009-05-29 Thread Grzegorz Jaśkiewicz
On Fri, May 29, 2009 at 3:37 AM, Scott Bailey arta...@comcast.net wrote: Did you read the article I sent you earlier? Well, the difference here is that this way db doesn't really check anything :) you just choose path of execution, that you created prior. That's cheating :p So yes, I read that

Re: [GENERAL] composite type and domain

2009-05-29 Thread Scott Bailey
Grzegorz Jaśkiewicz wrote: On Fri, May 29, 2009 at 3:37 AM, Scott Bailey arta...@comcast.net wrote: Did you read the article I sent you earlier? Well, the difference here is that this way db doesn't really check anything :) you just choose path of execution, that you created prior. That's

Re: [GENERAL] composite type and domain

2009-05-28 Thread Grzegorz Jaśkiewicz
2009/5/27 Scott Bailey arta...@comcast.net: Who said anything about the application level? can you give an example please ? -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] composite type and domain

2009-05-28 Thread Scott Bailey
Grzegorz Jaśkiewicz wrote: 2009/5/27 Scott Bailey arta...@comcast.net: Who said anything about the application level? can you give an example please ? Did you read the article I sent you earlier? I'm doing almost the exact same thing you are doing save the bytea field. I create a

Re: [GENERAL] composite type and domain

2009-05-27 Thread Merlin Moncure
2009/5/25 Grzegorz Jaśkiewicz gryz...@gmail.com: Why is it not possible to create domain on composite type ? Consider the example, I got (a bytea, b timestamp, c timestamp). Where b c always, and both b and c have some default value, a can stay null. Now, I don't want to go berserk, and

Re: [GENERAL] composite type and domain

2009-05-27 Thread Grzegorz Jaśkiewicz
When I start to complain about domains and types in postgresql, people often ask me - so what's exactly wrong with it - well, here you go. I am trying to provide some feedback ;) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] composite type and domain

2009-05-27 Thread Scott Bailey
Grzegorz Jaśkiewicz wrote: Why is it not possible to create domain on composite type ? Consider the example, I got (a bytea, b timestamp, c timestamp). Where b c always, and both b and c have some default value, a can stay null. Now, I don't want to go berserk, and create aditional table for

Re: [GENERAL] composite type and domain

2009-05-27 Thread Scott Bailey
Scott Bailey wrote: Grzegorz Jaśkiewicz wrote: Why is it not possible to create domain on composite type ? Consider the example, I got (a bytea, b timestamp, c timestamp). Where b c always, and both b and c have some default value, a can stay null. Now, I don't want to go berserk, and create

Re: [GENERAL] composite type and domain

2009-05-27 Thread Grzegorz Jaśkiewicz
well, I need database to guard data, not application. Application can check things too, but database's job is to make sure data is integral. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] composite type and domain

2009-05-27 Thread Scott Bailey
Grzegorz Jaśkiewicz wrote: well, I need database to guard data, not application. Application can check things too, but database's job is to make sure data is integral. Who said anything about the application level? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

[GENERAL] composite type and domain

2009-05-25 Thread Grzegorz Jaśkiewicz
Why is it not possible to create domain on composite type ? Consider the example, I got (a bytea, b timestamp, c timestamp). Where b c always, and both b and c have some default value, a can stay null. Now, I don't want to go berserk, and create aditional table for that, because type is shared

Re: [GENERAL] Composite type versus Domain constraints.

2005-04-13 Thread James Robinson
On Apr 12, 2005, at 4:48 PM, Tom Lane wrote: James Robinson [EMAIL PROTECTED] writes: insert into simple_table values (null, '(43)'); -- GRR works!!! It'll let any smallint in. What happened to the constraint? The composite-type input routine doesn't check any constraints ... and that includes

Re: [GENERAL] Composite type versus Domain constraints.

2005-04-13 Thread Tom Lane
James Robinson [EMAIL PROTECTED] writes: Thank you for the great info. If I may, here's another question. I am in the need of new scalar types, essentially domain'd smallints, hence why my composite type had but one composite member. Domain'd smallints would be great, but it seems when they

Re: [GENERAL] Composite type versus Domain constraints.

2005-04-13 Thread James Robinson
On Apr 13, 2005, at 11:50 AM, Tom Lane wrote: Thank you for the great info. If I may, here's another question. I am in the need of new scalar types, essentially domain'd smallints, hence why my composite type had but one composite member. Domain'd smallints would be great, but it seems when they

[GENERAL] Composite type versus Domain constraints.

2005-04-12 Thread James Robinson
I'm trying to experiment with domains and composite types under 8.0.2. It seems that domain constraints don't fire when the domain is embedded within a composite type: --- create domain simple as smallint default 0 constraint limits check (VALUE IN (0,1,2,3)); create type comp_simple as (

Re: [GENERAL] Composite type versus Domain constraints.

2005-04-12 Thread Tom Lane
James Robinson [EMAIL PROTECTED] writes: insert into simple_table values (null, '(43)'); -- GRR works!!! It'll let any smallint in. What happened to the constraint? The composite-type input routine doesn't check any constraints ... and that includes domains. You can make it work if you don't