According to the DOC I can not do that. But fully recreate table force me to do huge work instead of simple:
ALTER FOREIGN TABLE table_name ALTER SERVER new_server_name;
List your foreign data servers and note it oid:
select oid, * from pg_foreign_server
Find your foreign table:
select oid, * from pg_class where relkind = 'f'
Then modify system catalog pg_foreign_table
like:
update pg_foreign_table set ftserver = 11573931 where ftserver = 11573932 -- and ftrelid = YOUR_OID_RELID_FROM_PG_CLASS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With