write cursor script in postgresql
Budget: $10 – $30 USD
We need a script for the following:
A cursor that runs through all views with a name like 'obj' and 'view' in schema public
For each view, the scripts executes the following:
select * into [new_schema_name].tabel from view
So for all views (with name like 'obj_' and '_view') a table is created in the new schema.
The new schema is called: 'plat'
The new table is the view name, where the first 8 characters and '_view' is deleted, so for instance obj_vgo_boom_view is the view name; yhe table name is: boom
A cursor that runs through all views with a name like 'obj' and 'view' in schema public
For each view, the scripts executes the following:
select * into [new_schema_name].tabel from view
So for all views (with name like 'obj_' and '_view') a table is created in the new schema.
The new schema is called: 'plat'
The new table is the view name, where the first 8 characters and '_view' is deleted, so for instance obj_vgo_boom_view is the view name; yhe table name is: boom
Related categories:
PostgreSQL Programming