=> 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      [EMAIL PROTECTED]       http://yi.org/peter-e/


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to