I got a big problems here. Let's say I got the table A
(with columns like id
, name
etc) in the main database. So when I making INSERT
into A
I need to create new database lets say B_id
. I got .backup
file with database sturcture which suppose to use B_id
databases.
I guess I need to write trigger which activates script.
But how I suppose to wrtie the script which creates database(with name depends on id
number) and applies .backup
file to it? Is it even okay to do like that?
B_id
" ? – Craig Ringer Mar 26 at 10:30CREATE DATABASE
and/orpg_restore
or load an SQL script, using a trigger, when you do aninsert
into table on a different DB? Why on earth do you want to do that? – Craig Ringer Mar 26 at 10:46dblink
from a trigger, for example. It's just weird, awkward, and clumsy. – Craig Ringer Mar 26 at 11:46