BUG #8576: 'btree index keys must be ordered by attribute'

From: peter(dot)hicks(at)poggs(dot)co(dot)uk
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #8576: 'btree index keys must be ordered by attribute'
Date: 2013-11-02 15:05:02
Message-ID: E1Vccl4-0000CZ-Nv@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 8576
Logged by: Peter Hicks
Email address: peter(dot)hicks(at)poggs(dot)co(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-11-02 19:29:36 Re: [BUGS] BUG #8573: int4range memory consumption
Previous Message chris_prentice14 2013-11-02 08:46:22 BUG #8575: Issues with installing