joshua <jzuel...@arbormetrix.com> writes:
> I'm trying to create an implicit cast from an unknown type into a text array
> type by creating a simple array of size 1. e.g.

> create function textarray(unknown)
> returns text[]
> as 'select ARRAY[$1::text];'
> language sql
> immutable;

> create cast (unknown as text[]) with function textarray(unknown) as
> implicit;

No, that isn't gonna work.  "unknown" isn't a real type and the parser
doesn't use normal casting rules for it.  It's just a placeholder until
the parser can figure out what type an undecorated literal ought to be.

What's your actual problem?  (I don't see how this connects to COPY
at all --- COPY never does any type inference, nor any implicit
casting.)

                        regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to