lundi 20 avril 2015

postgreSQL - clone or update table between 2 schemas

This is the question:

DB a) regenerated table updated once in a day (dropdb / createdb / create table) not managed, neither maneageable

DB b) should show same data as a but be constantly accessed

how can I get the data in a to b ?

psql test -c \
"\copy (SELECT i, t FROM original_table ORDER BY i) TO STDOUT" | \
psql test -c "\copy copy_table (i, t) FROM STDIN"

this one is editable to take all columns as "*" would in a standard query?

Aucun commentaire:

Enregistrer un commentaire