From 042536967527e34d1f4cd0bb0aafa1aff678d8a2 Mon Sep 17 00:00:00 2001 From: Jordi BC Date: Mon, 2 Jan 2023 17:35:46 +0100 Subject: [PATCH] search_uids.py: Use pg_restore without "-f -" The reason is that by default it already behaves as if given the option -f - (which redirects to stdout). But some versions of pg_restore do not interpret "-f -" that way and instead create a file called "-". This change simplifies it and makes it compatible with all versions. --- DHIS2/database_dumps/search_uids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DHIS2/database_dumps/search_uids.py b/DHIS2/database_dumps/search_uids.py index 3c36cbaf..54d19562 100755 --- a/DHIS2/database_dumps/search_uids.py +++ b/DHIS2/database_dumps/search_uids.py @@ -15,7 +15,7 @@ def main(): fname = sys.argv[1] uids = sys.argv[2:] - cmd = (['pg_restore', '-f', '-', fname] if fname.endswith('.dump') else + cmd = (['pg_restore', fname] if fname.endswith('.dump') else ['cat', fname]) print(f'Tables and columns in {fname} where any of the uids appear:')