Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-13 Thread Daniele Varrazzo
On Mon, Feb 13, 2017 at 3:09 AM, Jim Nasby wrote: > On 2/7/17 9:16 AM, Daniele Varrazzo wrote: >> >> Thank you for the clarification: I will assume the behaviour cannot be >> maintained on PG 10 and think whether the treatment of '{}' is too >> magical and drop it instead. > > > BTW, I would hope

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-12 Thread Jim Nasby
On 2/7/17 9:16 AM, Daniele Varrazzo wrote: Thank you for the clarification: I will assume the behaviour cannot be maintained on PG 10 and think whether the treatment of '{}' is too magical and drop it instead. BTW, I would hope that passing '{}' into a defined array field still works, since an

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Daniele Varrazzo
On Tue, Feb 7, 2017 at 2:59 PM, Andreas Karlsson wrote: > On 02/07/2017 03:14 PM, Daniele Varrazzo wrote: >> >> In psycopg '{}'::unknown is treated specially as an empty array and >> converted into an empty list, which allows empty lists to be passed to >> the server as arrays and returned back to

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Daniele Varrazzo
On Tue, Feb 7, 2017 at 2:42 PM, Tom Lane wrote: > Daniele Varrazzo writes: >> testing with psycopg2 against Postgres 10 I've found a difference in >> behaviour regarding literals, which are returned as text instead of >> unknown. ... >> Is this behaviour here to stay? Is there documentation for t

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Andreas Karlsson
On 02/07/2017 03:14 PM, Daniele Varrazzo wrote: In psycopg '{}'::unknown is treated specially as an empty array and converted into an empty list, which allows empty lists to be passed to the server as arrays and returned back to python. Without the special case, empty lists behave differently fro

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Tom Lane
Daniele Varrazzo writes: > testing with psycopg2 against Postgres 10 I've found a difference in > behaviour regarding literals, which are returned as text instead of > unknown. ... > Is this behaviour here to stay? Is there documentation for this change? Yup, see https://git.postgresql.org/gitweb

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Pavel Stehule
Hi 2017-02-07 15:14 GMT+01:00 Daniele Varrazzo : > Hello, > > testing with psycopg2 against Postgres 10 I've found a difference in > behaviour regarding literals, which are returned as text instead of > unknown. In previous versions: > > In [2]: cnn = psycopg2.connect('') > In [3]: cur = cnn.curs

[HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Daniele Varrazzo
Hello, testing with psycopg2 against Postgres 10 I've found a difference in behaviour regarding literals, which are returned as text instead of unknown. In previous versions: In [2]: cnn = psycopg2.connect('') In [3]: cur = cnn.cursor() In [7]: cur.execute("select 'x'") In [9]: cur.description[0]