"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
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
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
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)