Re: Implicit casts to array types
От | Tom Lane |
---|---|
Тема | Re: Implicit casts to array types |
Дата | |
Msg-id | 436.1355499564@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Implicit casts to array types (joshua <jzuellig@arbormetrix.com>) |
Ответы |
Re: Implicit casts to array types
|
Список | pgsql-general |
joshua <jzuellig@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
В списке pgsql-general по дате отправления: