pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedcollation problem on 9.1-beta1
8+ messages / 5 participants
[nested] [flat]
* collation problem on 9.1-beta1
@ 2011-05-11 18:47 Marc Cousin <cousinmarc@gmail.com>
2011-05-11 18:58 ` Re: collation problem on 9.1-beta1 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: Marc Cousin @ 2011-05-11 18:47 UTC (permalink / raw)
To: pgsql-bugs
Hi,
I've been starting to work on a 'what's new in 9.1' like i did last
year, and am faced with what I feel is a bug, while building a demo case
for collation.
Here it is:
SELECT * from (values ('llegar'),('llorer'),('lugar')) as tmp
order by 1 collate "es_ES.utf8";
ERROR: collations are not supported by type integer at character 74
STATEMENT: SELECT * from (values ('llegar'),('llorer'),('lugar')) as
tmp
order by 1 collate "es_ES.utf8";
^
marc=# SELECT * from (values ('llegar'),('llorer'),('lugar')) as tmp
order by column1 collate "es_ES.utf8";
column1
---------
llegar
llorer
lugar
(3 rows)
Of course, without the collate keyword, the «order by 1» works as usual.
Regards
Marc
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collation problem on 9.1-beta1
2011-05-11 18:47 collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
@ 2011-05-11 18:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-06-02 12:09 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2011-05-11 18:58 UTC (permalink / raw)
To: Marc Cousin <cousinmarc@gmail.com>; +Cc: pgsql-bugs
Marc Cousin <cousinmarc@gmail.com> writes:
> I've been starting to work on a 'what's new in 9.1' like i did last
> year, and am faced with what I feel is a bug, while building a demo case
> for collation.
> Here it is:
> SELECT * from (values ('llegar'),('llorer'),('lugar')) as tmp
> order by 1 collate "es_ES.utf8";
> ERROR: collations are not supported by type integer at character 74
This isn't a bug, or at least not one we're going to fix. ORDER BY
column-number is a legacy syntax that doesn't support many options, and
COLLATE is one of the ones that it doesn't support.
(The actual technical reason for this is that COLLATE turns the argument
into a general expression, not something we can special-case. You would
get the same error from writing "1 COLLATE something" anyplace else.)
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collation problem on 9.1-beta1
2011-05-11 18:47 collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
2011-05-11 18:58 ` Re: collation problem on 9.1-beta1 Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-06-02 12:09 ` Peter Eisentraut <peter_e@gmx.net>
2011-06-02 15:28 ` Re: collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
2011-06-09 17:30 ` Re: collation problem on 9.1-beta1 Bruce Momjian <bruce@momjian.us>
0 siblings, 2 replies; 8+ messages in thread
From: Peter Eisentraut @ 2011-06-02 12:09 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marc Cousin <cousinmarc@gmail.com>; pgsql-bugs
On ons, 2011-05-11 at 14:58 -0400, Tom Lane wrote:
> Marc Cousin <cousinmarc@gmail.com> writes:
> > I've been starting to work on a 'what's new in 9.1' like i did last
> > year, and am faced with what I feel is a bug, while building a demo case
> > for collation.
>
> > Here it is:
>
> > SELECT * from (values ('llegar'),('llorer'),('lugar')) as tmp
> > order by 1 collate "es_ES.utf8";
> > ERROR: collations are not supported by type integer at character 74
>
> This isn't a bug, or at least not one we're going to fix. ORDER BY
> column-number is a legacy syntax that doesn't support many options, and
> COLLATE is one of the ones that it doesn't support.
>
> (The actual technical reason for this is that COLLATE turns the argument
> into a general expression, not something we can special-case. You would
> get the same error from writing "1 COLLATE something" anyplace else.)
Well, I'm just counting how many more people are going to complain about
this before fixing it. Possibly in 9.2.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collation problem on 9.1-beta1
2011-05-11 18:47 collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
2011-05-11 18:58 ` Re: collation problem on 9.1-beta1 Tom Lane <tgl@sss.pgh.pa.us>
2011-06-02 12:09 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
@ 2011-06-02 15:28 ` Marc Cousin <cousinmarc@gmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: Marc Cousin @ 2011-06-02 15:28 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-bugs
On 02/06/2011 14:09, Peter Eisentraut wrote:
> On ons, 2011-05-11 at 14:58 -0400, Tom Lane wrote:
>> Marc Cousin<cousinmarc@gmail.com> writes:
>>> I've been starting to work on a 'what's new in 9.1' like i did last
>>> year, and am faced with what I feel is a bug, while building a demo case
>>> for collation.
>>
>>> Here it is:
>>
>>> SELECT * from (values ('llegar'),('llorer'),('lugar')) as tmp
>>> order by 1 collate "es_ES.utf8";
>>> ERROR: collations are not supported by type integer at character 74
>>
>> This isn't a bug, or at least not one we're going to fix. ORDER BY
>> column-number is a legacy syntax that doesn't support many options, and
>> COLLATE is one of the ones that it doesn't support.
>>
>> (The actual technical reason for this is that COLLATE turns the argument
>> into a general expression, not something we can special-case. You would
>> get the same error from writing "1 COLLATE something" anyplace else.)
>
> Well, I'm just counting how many more people are going to complain about
> this before fixing it. Possibly in 9.2.
I wasn't complaining at all, just wondering if this was intended or not :)
But I'm sure that I won't be the only one to be caught by this, as it
took me about ten minutes to fall in this trap. That was the main reason
I reported this problem in the first place :)
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collation problem on 9.1-beta1
2011-05-11 18:47 collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
2011-05-11 18:58 ` Re: collation problem on 9.1-beta1 Tom Lane <tgl@sss.pgh.pa.us>
2011-06-02 12:09 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
@ 2011-06-09 17:30 ` Bruce Momjian <bruce@momjian.us>
2011-06-09 18:19 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
1 sibling, 1 reply; 8+ messages in thread
From: Bruce Momjian @ 2011-06-09 17:30 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marc Cousin <cousinmarc@gmail.com>; pgsql-bugs
Peter Eisentraut wrote:
> On ons, 2011-05-11 at 14:58 -0400, Tom Lane wrote:
> > Marc Cousin <cousinmarc@gmail.com> writes:
> > > I've been starting to work on a 'what's new in 9.1' like i did last
> > > year, and am faced with what I feel is a bug, while building a demo case
> > > for collation.
> >
> > > Here it is:
> >
> > > SELECT * from (values ('llegar'),('llorer'),('lugar')) as tmp
> > > order by 1 collate "es_ES.utf8";
> > > ERROR: collations are not supported by type integer at character 74
> >
> > This isn't a bug, or at least not one we're going to fix. ORDER BY
> > column-number is a legacy syntax that doesn't support many options, and
> > COLLATE is one of the ones that it doesn't support.
Column numbers in ORDER BY is ANSI syntax so I don't think calling them
"legacy" is accurate. "limited functionality"?
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collation problem on 9.1-beta1
2011-05-11 18:47 collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
2011-05-11 18:58 ` Re: collation problem on 9.1-beta1 Tom Lane <tgl@sss.pgh.pa.us>
2011-06-02 12:09 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
2011-06-09 17:30 ` Re: collation problem on 9.1-beta1 Bruce Momjian <bruce@momjian.us>
@ 2011-06-09 18:19 ` Peter Eisentraut <peter_e@gmx.net>
2011-06-09 18:22 ` Re: collation problem on 9.1-beta1 Robert Haas <robertmhaas@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Peter Eisentraut @ 2011-06-09 18:19 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marc Cousin <cousinmarc@gmail.com>; pgsql-bugs
On tor, 2011-06-09 at 13:30 -0400, Bruce Momjian wrote:
> Column numbers in ORDER BY is ANSI syntax so I don't think calling
> them "legacy" is accurate. "limited functionality"?
It was in SQL 92, but removed in 99, so it's technically no longer part
of the standard.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collation problem on 9.1-beta1
2011-05-11 18:47 collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
2011-05-11 18:58 ` Re: collation problem on 9.1-beta1 Tom Lane <tgl@sss.pgh.pa.us>
2011-06-02 12:09 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
2011-06-09 17:30 ` Re: collation problem on 9.1-beta1 Bruce Momjian <bruce@momjian.us>
2011-06-09 18:19 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
@ 2011-06-09 18:22 ` Robert Haas <robertmhaas@gmail.com>
2011-06-10 03:24 ` Re: collation problem on 9.1-beta1 Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 8+ messages in thread
From: Robert Haas @ 2011-06-09 18:22 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Bruce Momjian <bruce@momjian.us>; Tom Lane <tgl@sss.pgh.pa.us>; Marc Cousin <cousinmarc@gmail.com>; pgsql-bugs
On Thu, Jun 9, 2011 at 2:19 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On tor, 2011-06-09 at 13:30 -0400, Bruce Momjian wrote:
>> Column numbers in ORDER BY is ANSI syntax so I don't think calling
>> them "legacy" is accurate. "limited functionality"?
>
> It was in SQL 92, but removed in 99, so it's technically no longer part
> of the standard.
It's still extremely widely used though, I think, and very useful. I
don't feel we have to support GROUP BY 1 COLLATE whatever, but it
might be worth the trouble to at least emit a decent HINT.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: collation problem on 9.1-beta1
2011-05-11 18:47 collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
2011-05-11 18:58 ` Re: collation problem on 9.1-beta1 Tom Lane <tgl@sss.pgh.pa.us>
2011-06-02 12:09 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
2011-06-09 17:30 ` Re: collation problem on 9.1-beta1 Bruce Momjian <bruce@momjian.us>
2011-06-09 18:19 ` Re: collation problem on 9.1-beta1 Peter Eisentraut <peter_e@gmx.net>
2011-06-09 18:22 ` Re: collation problem on 9.1-beta1 Robert Haas <robertmhaas@gmail.com>
@ 2011-06-10 03:24 ` Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 8+ messages in thread
From: Bruce Momjian @ 2011-06-10 03:24 UTC (permalink / raw)
To: Robert Haas <robertmhaas@gmail.com>; +Cc: Peter Eisentraut <peter_e@gmx.net>; Tom Lane <tgl@sss.pgh.pa.us>; Marc Cousin <cousinmarc@gmail.com>; pgsql-bugs
Robert Haas wrote:
> On Thu, Jun 9, 2011 at 2:19 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> > On tor, 2011-06-09 at 13:30 -0400, Bruce Momjian wrote:
> >> Column numbers in ORDER BY is ANSI syntax so I don't think calling
> >> them "legacy" is accurate. ?"limited functionality"?
> >
> > It was in SQL 92, but removed in 99, so it's technically no longer part
> > of the standard.
Wow, they removed it; I use it all the time.
> It's still extremely widely used though, I think, and very useful. I
> don't feel we have to support GROUP BY 1 COLLATE whatever, but it
> might be worth the trouble to at least emit a decent HINT.
True. Seems now these numbers are PG extensions!
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2011-06-10 03:24 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11 18:47 collation problem on 9.1-beta1 Marc Cousin <cousinmarc@gmail.com>
2011-05-11 18:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-06-02 12:09 ` Peter Eisentraut <peter_e@gmx.net>
2011-06-02 15:28 ` Marc Cousin <cousinmarc@gmail.com>
2011-06-09 17:30 ` Bruce Momjian <bruce@momjian.us>
2011-06-09 18:19 ` Peter Eisentraut <peter_e@gmx.net>
2011-06-09 18:22 ` Robert Haas <robertmhaas@gmail.com>
2011-06-10 03:24 ` Bruce Momjian <bruce@momjian.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox