BUG #8576: 'btree index keys must be ordered by attribute' - Mailing list pgsql-bugs

From peter.hicks@poggs.co.uk
Subject BUG #8576: 'btree index keys must be ordered by attribute'
Date
Msg-id E1Vccl4-0000CZ-Nv@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #8576: 'btree index keys must be ordered by attribute'  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8576
Logged by:          Peter Hicks
Email address:      peter.hicks@poggs.co.uk
PostgreSQL version: 9.1.10
Operating system:   Ubuntu 12.04
Description:

Hello


The SQL code further down allows a btree index to be created with the same
column twice, however no queries are possible on the table and are met with
a "ERROR: XX000: btree index keys must be ordered by attribute".


This problem is reproducible on a newly created database on both 9.1.9 and
9.1.10 (9.1.10-0ubuntu12.04), and isn't present on 9.2.4 (OS X/Homebrew).


It looks like bug #6351
(http://www.postgresql.org/message-id/E1RdRfu-0004E9-8N@wrigleys.postgresql.org)
- was this ever fixed for 9.1.x?




DROP TABLE IF EXISTS scenario;


CREATE TABLE scenario
(
  id serial NOT NULL,
  f1 character varying(1),
  f2 character varying(1)
);


CREATE INDEX index_scenario
  ON scenario
  USING btree
  (f1, f2, f1);


SELECT COUNT(*) FROM scenario WHERE "f1" = 'A' AND "f2" = 'B';




---
Peter

pgsql-bugs by date:

Previous
From: chris_prentice14@hotmail.com
Date:
Subject: BUG #8575: Issues with installing
Next
From: Tom Lane
Date:
Subject: Re: BUG #8576: 'btree index keys must be ordered by attribute'