Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-14 Thread Alvaro Herrera
Excerpts from Greg Stark's message of vie ago 10 12:57:25 -0400 2012: On Thu, Aug 9, 2012 at 5:40 PM, Tom Lane t...@sss.pgh.pa.us wrote: Fair enough. I was not sold on doing that either. I would still like to know if it's okay to use one string with %s for the cases where there's not a

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-14 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Speaking of english words, I was wondering at check the other day. For example, we have #: catalog/heap.c:2171 #, c-format msgid check constraint \%s\ already exists #: catalog/heap.c:2534 #, c-format msgid only table \%s\ can be referenced

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-14 Thread Peter Eisentraut
On Fri, 2012-08-10 at 17:57 +0100, Greg Stark wrote: On Thu, Aug 9, 2012 at 5:40 PM, Tom Lane t...@sss.pgh.pa.us wrote: Fair enough. I was not sold on doing that either. I would still like to know if it's okay to use one string with %s for the cases where there's not a good reason for the

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-14 Thread Peter Eisentraut
On Tue, 2012-08-14 at 12:04 -0400, Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: Speaking of english words, I was wondering at check the other day. For example, we have #: catalog/heap.c:2171 #, c-format msgid check constraint \%s\ already exists #:

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-14 Thread Peter Eisentraut
On Tue, 2012-08-14 at 11:30 -0400, Alvaro Herrera wrote: And so on (there are several more). Note that here we use check constraint without any capitalization. However this doesn't translate too well as is; I mean, if I were to translate check into its equivalent spanish word, I'm sure to

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-10 Thread Greg Stark
On Thu, Aug 9, 2012 at 5:40 PM, Tom Lane t...@sss.pgh.pa.us wrote: Fair enough. I was not sold on doing that either. I would still like to know if it's okay to use one string with %s for the cases where there's not a good reason for the context to be more than just a SQL keyword. Given that

[HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-09 Thread Tom Lane
I wrote: I find it fairly annoying though that parseCheckAggregates (and likewise parseCheckWindowFuncs) have to dig through previously parsed query trees to look for misplaced aggregates; so adding even more of that is grating on me. It would be a lot cleaner if transformAggregateCall and

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-09 Thread Robert Haas
On Thu, Aug 9, 2012 at 11:56 AM, Tom Lane t...@sss.pgh.pa.us wrote: At the moment, the patch faithfully preserves (well, 99% preserves) the current spellings of the error messages, so that no regression test entries change. Once all those messages were brought together, it became painfully

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-09 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, Aug 9, 2012 at 11:56 AM, Tom Lane t...@sss.pgh.pa.us wrote: If we do go with the %s-for-a-SQL-keyword approach, it would then become tempting to force-fit all of the cases into that style. I don't really like this, though. I don't think an

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-09 Thread Alvaro Herrera
Excerpts from Tom Lane's message of jue ago 09 12:40:08 -0400 2012: Robert Haas robertmh...@gmail.com writes: On Thu, Aug 9, 2012 at 11:56 AM, Tom Lane t...@sss.pgh.pa.us wrote: If we do go with the %s-for-a-SQL-keyword approach, it would then become tempting to force-fit all of the cases

Re: [HACKERS] WIP patch for consolidating misplaced-aggregate checks

2012-08-09 Thread Tom Lane
Here's an updated version taking into account the discussion so far. It's still a net addition of code (about +200 lines according to diffstat), but I think the consolidation of logic is probably worth that. Any further comments? regards, tom lane binHLYugMFK3Z.bin