Postgres

[expired user #8249]'s profile image [expired user #8249] posted 10 years ago in General Permalink
Attempting to change the name of a table or view.
Throws and error similar to the following:-
ALTER VIEW "vw_wd_bradford_bfe" AS SELECT wd_dec_2013_gb_bfe.gid,
wd_dec_2013_gb_bfe.wd13cd,
wd_dec_2013_gb_bfe.wd13cdo,
wd_dec_2013_gb_bfe.wd13nm,
wd_dec_2013_gb_bfe.wd13nmw,
wd_dec_2013_gb_bfe.geom
FROM wd_dec_2013_gb_bfe
WHERE ((wd_dec_2013_gb_bfe.wd13cd)::text IN ( SELECT DISTINCT pcds_wd_par.wd11cd
FROM pcds_wd_par
WHERE ((pcds_wd_par.lad11nm)::text = 'Bradford'::text))); ;
/* ERROR: syntax error at or near "AS"
LINE 1: ALTER VIEW "vw_wd_bradford_bfe" AS SELECT wd_dec_2013_gb_bf...
^ */
[expired user #8249]'s profile image [expired user #8249] posted 10 years ago Permalink
Postgres sorry.
ansgar's profile image ansgar posted 10 years ago Permalink
Is there some rename command in PostgreSQL, which works for tables and views?
[expired user #8249]'s profile image [expired user #8249] posted 10 years ago Permalink
ALTER TABLE bd
RENAME TO bd1

ALTER VIEW vw_town
RENAME TO vw_town1

These both work in Heidi.
Code modification/commit from ansgar.becker, 10 years ago, revision 4816
Support renaming tables and views on PostgreSQL. See http://www.heidisql.com/forum.php?t=16305
ansgar's profile image ansgar posted 10 years ago Permalink
Works in r4816

Please login to leave a reply, or register at first.