Skip to content

Commit 54dc38d

Browse files
committed
preserve \.
1 parent 8822670 commit 54dc38d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/scripts/normalize-psql-dump.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44

55
def filter_lines(text):
6-
"""Remove irrelevant lines from the schema dump"""
7-
excluded_prefixes = ('SET ', 'SELECT ', 'GRANT ', 'REVOKE ', '\\')
6+
"""Remove irrelevant lines from the dump"""
7+
excluded_prefixes = ('SET ', 'SELECT ', 'GRANT ', 'REVOKE ')
88
lines = [
99
line for line in text.splitlines(keepends=True)
10-
if line.strip() and not line.startswith(excluded_prefixes)
10+
if line.strip()
11+
and not line.startswith(excluded_prefixes)
12+
and not (line.startswith('\\') and not line.startswith('\\.'))
1113
]
1214
return ''.join(lines)
1315

0 commit comments

Comments
 (0)