Re: [HACKERS] smallint out of range EXECUTEing prepared statement

2017-01-18 Thread Andrew Gierth
> "Justin" == Justin Pryzby writes: Justin> Is this expected behavior ? Justin> ts=# SELECT * FROM t WHERE site_id=32768 LIMIT 1; Justin> (0 rows) Justin> ts=# PREPARE x AS SELECT * FROM t WHERE site_id=$1 LIMIT 1; Justin> PREPARE Justin> ts=# EXECUTE x(32768);

Re: [HACKERS] smallint out of range EXECUTEing prepared statement

2017-01-18 Thread David G. Johnston
On Wed, Jan 18, 2017 at 3:15 PM, Justin Pryzby wrote: > Is this expected behavior ? ​​ > > ts=# SELECT * FROM t WHERE site_id=32768 LIMIT 1; > (0 rows) > > ts=# PREPARE x AS SELECT * FROM t WHERE site_id=$1 LIMIT 1; > PREPARE > ts=# EXECUTE x(32768); > ERROR: smallint out

[HACKERS] smallint out of range EXECUTEing prepared statement

2017-01-18 Thread Justin Pryzby
Is this expected behavior ? ts=# SELECT * FROM t WHERE site_id=32768 LIMIT 1; (0 rows) ts=# PREPARE x AS SELECT * FROM t WHERE site_id=$1 LIMIT 1; PREPARE ts=# EXECUTE x(32768); ERROR: smallint out of range ts=# PREPARE y AS SELECT * FROM t WHERE site_id::int=$1 LIMIT 1; PREPARE ts=# EXECUTE