Skip to content

Commit

Permalink
postgres escape column name in updated_at_rows query
Browse files Browse the repository at this point in the history
This is necessary if, for example, the column name is not all lowercase
  • Loading branch information
austinweisgrau committed Oct 10, 2024
1 parent 46cea73 commit cfc231a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions parsons/databases/postgres/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ def get_updated_rows(
FROM {self.table}
WHERE "{updated_at_column}" > %s
"""
parameters = []

if cutoff_value is not None:
sql += f'WHERE "{updated_at_column}" > %s'
parameters.append(cutoff_value)

if chunk_size:
sql += f" LIMIT {chunk_size}"

Expand Down

0 comments on commit cfc231a

Please sign in to comment.