Re: Bug or stupidity - Mailing list pgsql-general

From Thomas Hallgren
Subject Re: Bug or stupidity
Date
Msg-id thhal-0JBJaAkWU3kA7kcO+XZCxnrvrP0t47E@mailblocks.com
Whole thread Raw
In response to Re: Bug or stupidity  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout wrote:

>Sure, that's what you could do, but it makes the query rather more
>complex than it needs to be.
>
>
Do you consider this overly complex? Compare:

DELETE FROM x WHERE EXISTS (SELECT * FROM table WHERE x.a = table.a and
x.b > table.b and table.c = 4)

to:

DELETE FROM x, table WHERE x.a = table.a and x.b > table.b and table.c = 4

In the latter, what is it you are deleting? Is it x or table? I'm not at
all in favor of listing several tables in the FROM clause of a DELETE
statement (that includes implicitly adding them).

>transform_equals_null comes to mind. It's a hack to make 'x = NULL'
>work the way people coming from Oracle expect. It "fixes" it to be 'x
>IS NULL'.
>
>That is arguably something that could cause unexpected results.
>
>
I assume you mean transform_null_equals. If so, you just made my point.
It's disabled by default. Probably for the reason you mention.

>It has to be exactly one tuple. If there are zero tuples you get zero
>output. Cross-joining with an empty table produces no output. You're
>shipping a product where people expect to be able to add more rows to a
>table, but you never test that?
>
>
So how is this relevant to the argument? This is not about the
capabilities of an imaginary test framework. It was just an example!

>>As I said before, I don't object to the presence of this "option" so
>>that people that really knows _why_ they enable it can do so, but I
>>strongly object to having this option enabled by default. I suggest that:
>>
>>1. Have this option disabled by default.
>>2. Print WARNING's rather than notifications when tables are added.
>>
>>
>
>If you're not seeing NOTICEs now, what makes you think you'll see
>WARNINGs?
>
It's not totally uncommon for a test framework to trigger on warnings
and errors (for obvious reasons). My imaginary test actually did just
that (as stated).

>Every DB interface I've used so far displays the notices
>where I can see them. This notice is one of the less useful, there
>are other more useful warnings which are much more handy to see...
>
>
Right. Useful "warnings"! Seems you agree that this should be a warning,
not a notice.

Regards,
Thomas Hallgren





pgsql-general by date:

Previous
From: Daniel Savard
Date:
Subject: Arrays and constraints
Next
From: Tim Vadnais
Date:
Subject: field incrementing in a PL/pgSQL trigger