From: | ivan <iv(at)psycho(dot)pl> |
---|---|
To: | Rod Taylor <rbt(at)rbt(dot)ca> |
Cc: | PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: DOMAIN NEED CAST ? |
Date: | 2003-08-17 18:30:13 |
Message-ID: | Pine.LNX.4.56.0308172015310.13532@rex.anfa.pl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
but in real alias_to_int is equal to int, only with other name;
its should be like typedef from c/c++ ?
On Sun, 17 Aug 2003, Rod Taylor wrote:
> On Sun, 2003-08-17 at 12:34, ivan wrote:
> > Why when i create domain like :
> >
> > CREATE DOMAIN alias_to_int AS INT;
> >
> > and then function like :
> >
> > CREATE FUNCTION func() RETURNS alist_to_int AS ' select 2::int; ' LANGUAGE
> > SQL;
> >
> > and pg can not convert int to aliast_to_int, so i need to create cast for
> > all this same types ?
>
> PostgreSQL will not cast your function return results for you.
>
> rbt=# create function func() returns integer as 'select 2::int2'
> language sql;
> ERROR: return type mismatch in function: declared to return integer,
> returns smallint
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Sean Chittenden | 2003-08-17 18:36:08 | Re: compile error on cvs tip |
Previous Message | Shachar Shemesh | 2003-08-17 16:55:00 | bidirectional cursors on views |