Re: Creating a VIEW with a POINT column

From: Nick <nboutelier(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Creating a VIEW with a POINT column
Date: 2008-06-25 21:51:48
Message-ID: d354932e-774a-44cf-ac52-9c2c3d97f7bf@z32g2000prh.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nope, im not ordering by the POINT column. Heres an example...

CREATE TABLE table1 (
title character varying,
sorter integer,
xy point
);

CREATE TABLE table2 (
title character varying,
sorter integer,
xy point
);

INSERT INTO table1 VALUES ('one', 1, '(1,1)');
INSERT INTO table1 VALUES ('two', 2, '(2,2)');
INSERT INTO table1 VALUES ('three', 3, '(3,3)');
INSERT INTO table2 VALUES ('four', 4, '(4,4)');
INSERT INTO table2 VALUES ('five', 5, '(5,5)');
INSERT INTO table2 VALUES ('six', 6, '(6,6)');

CREATE VIEW myview AS
SELECT table1.title, table1.sorter, table1.xy FROM table1 UNION
SELECT table2.title, table2.sorter, table2.xy FROM table2;

SELECT title FROM myview ORDER BY sorter;

ERROR: could not identify an ordering operator for type point
HINT: Use an explicit ordering operator or modify the query.

In statement:
SELECT title FROM myview ORDER BY sorter

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2008-06-25 23:02:58 Re: CVS Head psql bug?
Previous Message Tom Lane 2008-06-25 21:02:58 Re: CVS Head psql bug?