dbTalk Databases Forums  

[BUGS] "blah" is not a domain error

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] "blah" is not a domain error in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default [BUGS] "blah" is not a domain error - 05-24-2006 , 04:19 PM






I know domain support is pretty broken, so maybe this is a known issue...

decibel=# create table test(m money);
CREATE TABLE
decibel=# insert into test values('-1.00');
INSERT 0 1
decibel=# alter domain money add check(money>0);
ERROR: "money" is not a domain
decibel=# drop domain money;
ERROR: "money" is not a domain
decibel=# \dD
List of domains
Schema | Name | Type | Modifier | Check
--------+------+------+----------+-------
(0 rows)

decibel=# \d test
Table "public.test"
Column | Type | Modifiers
--------+-------+-----------
m | money |

decibel=# create domain money as numeric(99,2);
ERROR: type "money" already exists
decibel=# select version();
version
-------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 8.1.2 on powerpc-apple-darwin8.4.0, compiled by GCC powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 20041026 (Apple Computer, Inc. build 4061)
(1 row)

decibel=#
--
Jim C. Nasby, Sr. Engineering Consultant jnasby (AT) pervasive (DOT) com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] "blah" is not a domain error - 05-24-2006 , 04:30 PM






"Jim C. Nasby" <jnasby (AT) pervasive (DOT) com> writes:
Quote:
I know domain support is pretty broken, so maybe this is a known issue...
What are you concerned about exactly? It looks perfectly reasonable
to me. "money" is a base type not a domain.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] "blah" is not a domain error - 05-26-2006 , 04:46 PM



On Wed, May 24, 2006 at 05:29:34PM -0400, Tom Lane wrote:
Quote:
"Jim C. Nasby" <jnasby (AT) pervasive (DOT) com> writes:
I know domain support is pretty broken, so maybe this is a known issue...

What are you concerned about exactly? It looks perfectly reasonable
to me. "money" is a base type not a domain.
Oops... I thought we'd removed it.

Shouldn't it be an error to create a domain that conflicts with an existing
type?

bench=# create domain money as numeric(21,2);
CREATE DOMAIN
bench=# drop domain money;
ERROR: "money" is not a domain
bench=# create domain money as numeric(21,2);
ERROR: type "money" already exists
bench=# select version();
version
------------------------------------------------------------------------------------------------------
PostgreSQL 8.2devel on x86_64-unknown-freebsd6.0, compiled by GCC gcc (GCC) 3.4.4 [FreeBSD] 20050518
(1 row)

bench=#
--
Jim C. Nasby, Sr. Engineering Consultant jnasby (AT) pervasive (DOT) com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] "blah" is not a domain error - 05-26-2006 , 06:26 PM



"Jim C. Nasby" <jnasby (AT) pervasive (DOT) com> writes:
Quote:
Shouldn't it be an error to create a domain that conflicts with an existing
type?
It is, if you create it in the same schema. "money", along with all the
other built-in types, is in pg_catalog not public.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.