Re: Type of text literals - Mailing list pgsql-novice

From Tom Lane
Subject Re: Type of text literals
Date
Msg-id 5273.1531263275@sss.pgh.pa.us
Whole thread Raw
In response to Type of text literals  (Steve Baldwin <steve.baldwin@gmail.com>)
List pgsql-novice
Steve Baldwin <steve.baldwin@gmail.com> writes:
> Can someone please help me understand this:

> b2bc_dev=# select pg_typeof('a') as a, pg_typeof(array['a']) as arr;
>     a    |  arr
> ---------+--------
>  unknown | text[]
> (1 row)

> Why is a text literal on its own 'unknown' whereas in the context of an
> array it assumes 'text' ?

There is no "unknown[]" type, so it has to assume something.

            regards, tom lane


pgsql-novice by date:

Previous
From: Steve Baldwin
Date:
Subject: Type of text literals
Next
From: JORGE MALDONADO
Date:
Subject: Please advice on a query