The following bug has been logged on the website:
Bug reference: 13789
Logged by: Alex Maslennikov
Email address: amsl.sm@gmail.com
PostgreSQL version: 9.4.5
Operating system: Windows 7
Description:
I have a view defined with the following sql statement:
CREATE OR REPLACE VIEW my_view AS
(
select s.id as start_id
from start s
group by s.id
order by start_date desc
);
When pg_admin exports this view it outputs it as as table not view:
CREATE TABLE my_view (
start_id integer
);
Removing "order by" from view fixes the problem, but "order by" is a valid
syntax for a view.