=> 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@gmx.net http://yi.org/peter-e/