Prepared statements assume text type in PG10

From: Jack Christensen <jack(at)jackchristensen(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Prepared statements assume text type in PG10
Date: 2017-10-07 21:56:26
Message-ID: 9728d447-2856-27e2-24f7-d889d61d0fb9@jackchristensen.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The test suite for the Go PostgreSQL driver pgx
(https://github.com/jackc/pgx) found an unexpected behavior change in
PG10. Previously, it was impossible to prepare a statement with a
unknown or ambiguous parameter type.

Pre-version 10:

jack=# prepare ps as select $1;
ERROR:  could not determine data type of parameter $1

But on PG10 the type defaults to text:

jack=# prepare ps as select $1;
PREPARE
Time: 0.183 ms
jack=# execute ps('Hello, there');
   ?column?
--------------
 Hello, there
(1 row)

Time: 0.437 ms

I looked through the git log and couldn't find any commits referencing
this. Is this an intended behavior change?

Jack

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2017-10-07 22:10:41 Re: tablespaces inside $PGDATA considered harmful
Previous Message Petr Jelinek 2017-10-07 21:22:52 Re: Discussion on missing optimizations