Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Dump/restore of views containing select distinct fails


  • From: Peter Eisentraut <peter_e(at)gmx(dot)net>
  • To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
  • Subject: Dump/restore of views containing select distinct fails
  • Date: Fri, 13 Apr 2001 13:32:16 +0200 (CEST)
  • Message-id: <Pine(dot)LNX(dot)4(dot)30(dot)0104131320270(dot)945-100000(at)peter(dot)localdomain>

=> create view testview as select relname, 'Constant'::text from pg_class;

=> \d testview
       View "testview"
 Attribute | Type | Modifier
-----------+------+----------
 relname   | name |
 ?column?  | text |
View definition: SELECT DISTINCT pg_class.relname, 'Constant'::text FROM
pg_class ORDER BY pg_class.relname, 'Constant'::text;

Note how the order by clause is not valid SQL.  You get

ERROR:  Non-integer constant in ORDER BY

I suppose the ORDER BY clause appears because of some weird query parse
tree hackery and is not easy to get rid of.  Maybe using column numbers
instead of spelling out the select list again would work?

-- 
Peter Eisentraut      peter_e(at)gmx(dot)net       http://yi.org/peter-e/




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group