Hi all,
I need little help please,
I'v already foreign tables (from oracle_fdw) in my postgresql
environment.
I'm Just looking for script shell or sql ( easy way) to migrate
this foreign tables to locale table .
My script below has some issue
thanks lot
------script migrate---
#!/bin/bash
export PGDATA=/pg01/pgdata/9.6/data
export PGUSER="postgres"
export PGPORT="5433"
export PGPASSWORD="ttooe2"
for tbl in `psql -qAt data_2020
-c "select foreign_table_name from information_schema.foreign_tables;"`;
do psql data_2020 -c "create table public.\"$tbl\" as select * from
fdw_link.\"$tbl\"" ; done
----end of script---
the database is : data_2020
foreign_table schema is : fdw_link
and want to copy to public schema