Re: Make foo=null a warning by default.

2018-12-01 Thread Dmitry Dolgov
> On Mon, Nov 26, 2018 at 9:19 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Tue, Aug 7, 2018 at 11:19 PM Bruce Momjian wrote: > > > > On Mon, Jul 16, 2018 at 11:37:28AM -0400, Tom Lane wrote: > > > Heikki Linnakangas writes: > > > > On 16/07/18 18:10, Tom Lane wrote: > > > >> TBH I'm

Re: Make foo=null a warning by default.

2018-11-26 Thread Dmitry Dolgov
> On Tue, Aug 7, 2018 at 11:19 PM Bruce Momjian wrote: > > On Mon, Jul 16, 2018 at 11:37:28AM -0400, Tom Lane wrote: > > Heikki Linnakangas writes: > > > On 16/07/18 18:10, Tom Lane wrote: > > >> TBH I'm not really excited about investing any work in this area at all. > > >> Considering how seldo

Re: Make foo=null a warning by default.

2018-08-07 Thread Bruce Momjian
hOn Mon, Jul 16, 2018 at 11:37:28AM -0400, Tom Lane wrote: > Heikki Linnakangas writes: > > On 16/07/18 18:10, Tom Lane wrote: > >> TBH I'm not really excited about investing any work in this area at all. > >> Considering how seldom we hear any questions about transform_null_equals > >> anymore[1]

Re: Make foo=null a warning by default.

2018-07-21 Thread David Fetter
On Sat, Jul 21, 2018 at 04:23:14PM -0400, Fabien COELHO wrote: > > Hello David, > > >>[...] > > > >Fixed. > > > >>[...] > > > >I've changed it to something that makes more sense to me. Hope it > >makes more sense to others. > > Ok, all is fine for me. > > I could not find a CF entry, so I creat

Re: Make foo=null a warning by default.

2018-07-21 Thread Fabien COELHO
Hello David, [...] Fixed. [...] I've changed it to something that makes more sense to me. Hope it makes more sense to others. Ok, all is fine for me. I could not find a CF entry, so I created one: https://commitfest.postgresql.org/19/1728/ -- Fabien.

Re: Make foo=null a warning by default.

2018-07-19 Thread David Fetter
On Thu, Jul 19, 2018 at 06:37:39AM -0400, Fabien COELHO wrote: > > Hello David, > > All is nearly well, although "make docs" found a typo. I should have tested > doc building before, sorry for this new round which should have been > avoided. > > "null_expression" > > s///; Fixed. > Also, wh

Re: Make foo=null a warning by default.

2018-07-19 Thread Fabien COELHO
Hello David, All is nearly well, although "make docs" found a typo. I should have tested doc building before, sorry for this new round which should have been avoided. "null_expression" s///; Also, while reading the full documentation about the setting: I find this sentence a bit strang

Re: Make foo=null a warning by default.

2018-07-18 Thread David Fetter
On Wed, Jul 18, 2018 at 04:15:30PM -0400, Fabien COELHO wrote: > > >[...] Done. > > All looks well, but I just noticed a warning: > > gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement > -Wendif-labels -Wmissing-format-attribute -Wformat-security > -fno-strict-aliasi

Re: Make foo=null a warning by default.

2018-07-18 Thread Fabien COELHO
[...] Done. All looks well, but I just noticed a warning: gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -I. -I. -I

Re: Make foo=null a warning by default.

2018-07-18 Thread David Fetter
On Wed, Jul 18, 2018 at 08:25:46AM -0400, Fabien COELHO wrote: > > Hello David, > > >I assure you that you expression yourself in English a good deal > >better than I do in Portuguese. > > Alas, despite a Portuguese "rabbit" name, I cannot speak the language which > got lost between generations.

Re: Make foo=null a warning by default.

2018-07-18 Thread Fabien COELHO
Hello David, I assure you that you expression yourself in English a good deal better than I do in Portuguese. Alas, despite a Portuguese "rabbit" name, I cannot speak the language which got lost between generations. About this v3: Patch applies, compiles, "make check" ok. A few minor com

Re: Make foo=null a warning by default.

2018-07-17 Thread David Fetter
On Tue, Jul 17, 2018 at 08:34:17AM -0400, Fabien COELHO wrote: > > Hello David, > > A few comments about this v2. > > ISTM that there is quite strong opposition to having "warn" as a default, so > probably you should set if "off"? Done. > >>I do not really understand the sort order of this arr

Re: Make foo=null a warning by default.

2018-07-17 Thread Fabien COELHO
Hello David, A few comments about this v2. ISTM that there is quite strong opposition to having "warn" as a default, so probably you should set if "off"? transform_null_equals_options[] = { [...] I do not really understand the sort order of this array. Maybe it could be alphabetical, or

Re: Make foo=null a warning by default.

2018-07-17 Thread Fabien COELHO
Hello, Yeah, I was wondering about that too. But Fabien brought up a completely new use-case for this: people learning SQL. Indeed. This year, about 30% of my students wrote "= NULL" in a query at least once. Probably I or a colleague were called to the rescue for help. So this warning w

Re: Make foo=null a warning by default.

2018-07-16 Thread David Fetter
On Mon, Jul 16, 2018 at 11:37:28AM -0400, Tom Lane wrote: > Heikki Linnakangas writes: > > On 16/07/18 18:10, Tom Lane wrote: > >> TBH I'm not really excited about investing any work in this area at all. > >> Considering how seldom we hear any questions about transform_null_equals > >> anymore[1],

Re: Make foo=null a warning by default.

2018-07-16 Thread David Fetter
t. > > Maybe "warn" in the doc should be warn or something. Fixed. Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate >From 33b9f51b1374ede71a6479d44adf

Re: Make foo=null a warning by default.

2018-07-16 Thread Tom Lane
Heikki Linnakangas writes: > On 16/07/18 18:10, Tom Lane wrote: >> TBH I'm not really excited about investing any work in this area at all. >> Considering how seldom we hear any questions about transform_null_equals >> anymore[1], I'm wondering if we couldn't just rip the "feature" out >> entirely

Re: Make foo=null a warning by default.

2018-07-16 Thread Heikki Linnakangas
On 16/07/18 18:10, Tom Lane wrote: Heikki Linnakangas writes: On 16/07/18 04:40, David Fetter wrote: Per a discussion with Andrew Gierth and Vik Fearing, both of whom helped make this happen, please find attached a patch which makes it possible to get SQL standard behavior for "= NULL", which

Re: Make foo=null a warning by default.

2018-07-16 Thread Tom Lane
Heikki Linnakangas writes: > On 16/07/18 04:40, David Fetter wrote: >> Per a discussion with Andrew Gierth and Vik Fearing, both of whom >> helped make this happen, please find attached a patch which makes it >> possible to get SQL standard behavior for "= NULL", which is an error. >> It's been up

Re: Make foo=null a warning by default.

2018-07-16 Thread Robert Haas
On Mon, Jul 16, 2018 at 3:49 AM, Heikki Linnakangas wrote: > I don't agree with changing the default to 'warn'. "foo = NULL" is perfectly > legal SQL, even if it's not very useful in practice. +1. I think that will probably generate lots of annoying warnings in server logs compared to the value

Re: Make foo=null a warning by default.

2018-07-16 Thread Fabien COELHO
Hello Heikki, The use case for transform_null_equals='warn' that I see is to wean off an application that uses transform_null_equals='on', to find all the queries that rely on it. But I'm not too excited about that either. The documented case for using transform_null_equals='on' is compatibi

Re: Make foo=null a warning by default.

2018-07-16 Thread Heikki Linnakangas
On 16/07/18 04:40, David Fetter wrote: Folks, Per a discussion with Andrew Gierth and Vik Fearing, both of whom helped make this happen, please find attached a patch which makes it possible to get SQL standard behavior for "= NULL", which is an error. It's been upgraded to a warning, and can sti

Re: Make foo=null a warning by default.

2018-07-16 Thread Fabien COELHO
Hello David, Per a discussion with Andrew Gierth and Vik Fearing, both of whom helped make this happen, please find attached a patch which makes it possible to get SQL standard behavior for "= NULL", which is an error. It's been upgraded to a warning, and can still be downgraded to silence (of

Make foo=null a warning by default.

2018-07-15 Thread David Fetter
ter Date: Sun, 15 Jul 2018 16:11:08 -0700 Subject: [PATCH] Make foo=null a warning by default To: pgsql-hack...@postgresql.org The transform_null_equals GUC is now an enum consisting of on, off, warn (default), and error. --- doc/src/sgml/config.sgml | 14 +++--- src/backend/p