Re: [HACKERS] domain casting?

2007-08-10 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > Is possible casting domain? No, because find_coercion_pathway() expects that only base types are listed in pg_cast, so it starts by stripping domains. Function lookup tends to do that too, so it's hard even to declare a function as taking a domain. E

[HACKERS] domain casting?

2007-08-10 Thread Pavel Stehule
Hello I try casting function for domains. I can do it, but it doesn't work. betal=# create domain mydomain text; CREATE DOMAIN betal=# betal=# create or replace function mydomain_todate(mydomain) betal-# returns date as $$ betal$# select to_date($1, 'MMDD'); betal$# $$ language sql; CREATE

Re: [HACKERS] Domain casting still doesn't work right

2003-06-28 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Here's another example of domain casting not working right: > create domain foo as varchar; > select cast(x.y as foo) from (select 'foo') as x(y); > ERROR: coerce_type: no conversion function from "unknown" to foo Not the domain's fault. You get the

[HACKERS] Domain casting still doesn't work right

2003-06-28 Thread Peter Eisentraut
Here's another example of domain casting not working right: create domain foo as varchar; select cast(x.y as foo) from (select 'foo') as x(y); ERROR: coerce_type: no conversion function from "unknown" to foo -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)