Re: Creating a VIEW with a POINT column - Mailing list pgsql-hackers

From Nick
Subject Re: Creating a VIEW with a POINT column
Date
Msg-id d354932e-774a-44cf-ac52-9c2c3d97f7bf@z32g2000prh.googlegroups.com
Whole thread Raw
In response to Creating a VIEW with a POINT column  (Nick <nboutelier@hotmail.com>)
Responses Re: Creating a VIEW with a POINT column  (Jan Urbański <j.urbanski@students.mimuw.edu.pl>)
List 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CVS Head psql bug?
Next
From: Tatsuo Ishii
Date:
Subject: Re: CVS Head psql bug?