Thread: BUG #11825: "select lead('literal text') ..." -> could not determine polymorphic type

BUG #11825: "select lead('literal text') ..." -> could not determine polymorphic type

From
casey@cloudera.com
Date:
The following bug has been logged on the website:

Bug reference:      11825
Logged by:          casey
Email address:      casey@cloudera.com
PostgreSQL version: 9.3.5
Operating system:   ubuntu 14.04
Description:

Some analytic functions such as LEAD/FIRST_VALUE don't accept char literals
as input, an example is below. This came up randomly during some testing. I
don't have a good use case for such a query and it's easy to workaround but
it seems odd so I thought I'd report it.

functional=# select version();
                                               version

------------------------------------------------------------------------------------------------------
 PostgreSQL 9.3.5 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu
4.8.2-19ubuntu1) 4.8.2, 64-bit
(1 row)

functional=# create table empty (c int);
CREATE TABLE
functional=# SELECT LEAD('a') OVER () FROM empty;
ERROR:  could not determine polymorphic type because input has type
"unknown"