Gurupreet Singh Bhatia February 2016

Versioning in Greenplum Database

Is anyone doing versioning of Greenplum Code?

Can anyone help on this, is there any direct tool or method which can help in manage version of GP DDL/Code of database objects (Tables, Functions, Views)

Regards,

Answers


Jon Roberts February 2016

I've had the best success of using a cron job to commit any changes to a source control system like git or subversion on a daily basis.

--create a SQL file per schema
for i in $(psql -t -A -c "select nspname from pg_namespace where nspname not like 'pg_%' and nspname not like '%toolkit' and nspname not in ('information_schema', 'madlib', 'public') order by nspname;"); do 
    echo $i 
    pg_dump -s -n $i -f $i.sql
done

for i in $(ls *.sql); do
    #your code to commit the changes to source control like git
done

Post Status

Asked in February 2016
Viewed 3,480 times
Voted 4
Answered 1 times

Search




Leave an answer