db-to-sqlite icon indicating copy to clipboard operation
db-to-sqlite copied to clipboard

Views, Materialized Views, Functions not exported from Postgres database to SQLite file

Open priyadarshiniguptan opened this issue 3 years ago • 1 comments

I am trying to export a few schemas from my postgres database to SQLite as below:

/home/admin/.local/bin/db-to-sqlite "postgresql://postgres:[email protected]:5432/configuration" cplabor.db --all --postgres-schema dbd_cp_labor

This particular schema has views , materialized views , functions and datatypes as well apart from tables. However when I run -

❯ sqlite3 cplabor.db
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
sqlite> Select * from dbd_cp_labor.vw_revenue_by_year;
Error: no such table: dbd_cp_labor.vw_revenue_by_year
sqlite> Select * from vw_revenue_by_year;
Error: no such table: vw_revenue_by_year

I am able to see only the tables and not the views or functions. Could I be missing something here. Please guide.

priyadarshiniguptan avatar Jul 06 '21 06:07 priyadarshiniguptan

sqlite does not support function and materialized views in the postgresql sense

same goes for data types, i suspect viws also don't transfer easily

RonnyPfannschmidt avatar Aug 14 '21 22:08 RonnyPfannschmidt