Search Postgresql Archives

Re: String literal doesn't autocast to text type

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

 



Alex Ignatov <a.ignatov@xxxxxxxxxxxxxx> writes:
> Why string literal like 'Hello world!' doesnt automagicaly cast to text 
> type?

Because it's not necessarily a string.  It might be meant to be point,
or json, or any number of other types.

> Sure we can create our cast:
> postgres=# create cast (unknown as text) with inout as implicit;
> CREATE CAST

That's a seriously bad idea; it will have all sorts of corner-case
effects that you aren't expecting.

There has been some talk of forcing unknown to text in the output
columns of a sub-SELECT, which would fix the example you show with
a lot less risk of side-effects elsewhere.  But it's not exactly
trivial because of interactions with INSERT ... SELECT.

			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