Search Postgresql Archives

Re: Implicit casts to array types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



joshua <jzuellig@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux