Postgre supports this operation as below:
ALTER TABLE name
SET SCHEMA new_schema
The operation won't work in Redshift. Is there any way to do that?
I tried to update pg_class to set relnamespace(schema id) for the table, which needs superuser account and usecatupd is true in pg_shadow table. But I got permission denied error. The only account who can modify pg system table is rdsdb.
server=# select * from pg_user;
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig
------------+----------+-------------+----------+-----------+----------+----------+----------------------------------
rdsdb | 1 | t | t | t | ******** | |
myuser | 100 | t | t | f | ******** | |
So really redshift gives no permission for that?