Re: How to get some table entries from backup instance back to production instance
От | Marcel Ruff |
---|---|
Тема | Re: How to get some table entries from backup instance back to production instance |
Дата | |
Msg-id | 54DB0CA0.2000009@marcelruff.info обсуждение исходный текст |
Ответ на | Re: How to get some table entries from backup instance back to production instance (daku.sandor@gmail.com) |
Список | pgsql-novice |
Ok, thank you, this seems to be the way.
What about the children and grandchildren?
Is there a way to cascade the "pa" query or do I need to query "children" and "grandchildren"
with separate extra queries?
Thanks
Marcel
On 10.02.2015 10:04, daku.sandor@gmail.com wrote:
What about the children and grandchildren?
Is there a way to cascade the "pa" query or do I need to query "children" and "grandchildren"
with separate extra queries?
Thanks
Marcel
On 10.02.2015 10:04, daku.sandor@gmail.com wrote:
Hi,I would do this way:After the first step select the required records into another tables with CREATE TABLE patmp AS SELECT * FROM pa WHERE ...Move these temporary tables to the prod database by dump and restore and transfer the content into the prod tables with INSERT INTO pa SELECT * FROM patmp.Done.Regards,Sándor DakuHi,
I have 4 tables with 1:n relation:
grandpa -> pa -> child -> grandchild
Now I need to copy an instance of "pa" with his descendants
from my backup (a postgres dump) back to prod.
"grandchild" has a blob column (containing fotos)
Which options do I have?
1) Import the backup dump in a separate postgres instance
2) Do some magic query which created insert statements
3) Run the insert statements on the prod server
What is the best approach, and how does a query look like which
returns nicely formatted insert lines?
Thank you
Marcel
В списке pgsql-novice по дате отправления: