It will be better if you can just leave these tables empty instead of dropping them entirely.
When do you need this? (YYYY/MM/DD) Asap
When is this no longer needed or useful? (YYYY/MM/DD)
If we cannot complete your request, what is the impact? Current development environment for Anitya is using production dump and without these tables you are getting error every time application works with user (login, check if admin etc.)
Metadata Update from @bowlofeggs: - Issue priority set to: Waiting on Assignee (was: Needs Review) - Issue tagged with: database, release-monitoring
@zlopez This is the commit that made the change:
https://infrastructure.fedoraproject.org/cgit/ansible.git/commit/?id=f0c596c427cc591148634d31cbe521579fc462ff
You may be able to adjust it to insert the empty tables you desire, or you may be able to adjust the development environment to do so.
@bowlofeggs I got advice from @mizdebsk on IRC, that this could be done by running sed '/COPY table_name /,/\./d' on dump. Is this possible, when the tables were excluded from actual dump?
sed '/COPY table_name /,/\./d'
On Tue, 2018-10-09 at 14:24 +0000, Michal Kone=C4=8Dn=C3=BD wrote:
I got advice from @mizdebsk on IRC, that this could be done by running sed '/COPY table_name /,/\./d' on dump. Is this possible, when the tables were excluded from actual dump?
The database dump is a text file, so there are a variety of ways you could edit it to add an empty version of the table to it.
Ok, I will then just play with it.
My idea was not to exclude these tables from pg_dump, but instead truncate them on-the-fly, eg with sed, i.e. replace pg_dump -T users $DB | ... with pg_dump $DB | sed '/COPY users /,/\./d' | ...
pg_dump -T users $DB | ...
pg_dump $DB | sed '/COPY users /,/\./d' | ...
Note that these were dropped for security reasons, so make sure sensitive data isn't being published.
I think we can switch -T to --exclude-table-data for these tho and have the table exist, but have no data in it. Would that work?
@kevin This will be ideal
I've proposed a freeze break to do this (since db01 is frozen).
This is in place and theres a new dump that should be correct.
Let me know if it's not. :suspension_railway:
Metadata Update from @kevin: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
Everything is working as expected. Thanks for the patch.
Login to comment on this ticket.