casting in ORDER BY

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: casting in ORDER BY
Date: 2009-02-15 20:45:40
Message-ID: 1234730740.1325.41.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I try to fix foreign_data regression test for Czech locale (HEAD). For
example I replaced

SELECT * FROM information_schema.user_mapping_options ORDER BY 1, 2, 3,
4;

with following statement:

SELECT * FROM information_schema.user_mapping_options ORDER BY 1, 2,
3::name, 4;

which should use C sorting rules on thirds column, but it look likes
that third column is ignored. See diff:

(4 rows)

SET ROLE regress_test_role;
! SELECT * FROM information_schema.user_mapping_options ORDER BY 1, 2, 3, 4;
authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
--------------------------+------------------------+---------------------+-------------+--------------
PUBLIC | regression | st1 | modified | 1
regress_test_role | regression | s5 | modified | 1
- regress_test_role | regression | s6 | username | test
regress_test_role | regression | st1 | password | boo
regress_test_role | regression | st1 | username | bob
(5 rows)

--- 711,723 ----
(4 rows)

SET ROLE regress_test_role;
! SELECT * FROM information_schema.user_mapping_options ORDER BY 1, 2, 3::name, 4;
authorization_identifier | foreign_server_catalog | foreign_server_name | option_name | option_value
--------------------------+------------------------+---------------------+-------------+--------------
PUBLIC | regression | st1 | modified | 1
regress_test_role | regression | s5 | modified | 1
regress_test_role | regression | st1 | password | boo
+ regress_test_role | regression | s6 | username | test
regress_test_role | regression | st1 | username | bob
(5 rows)

Is it bug or I overlook something?

Zdenek

PS: Regression test patch is attached.

Attachment Content-Type Size
reg.patch text/x-patch 2.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-02-15 20:51:18 Re: casting in ORDER BY
Previous Message BogDan Vatra 2009-02-15 19:55:56 Re: SE-PostgreSQL and row level security