diff --git a/db_converter.py b/db_converter.py index 7f1bc9a..25c504e 100644 --- a/db_converter.py +++ b/db_converter.py @@ -158,7 +158,7 @@ def parse(input_filename, output_filename): # ID fields need sequences [if they are integers?] if name == "id" and set_sequence is True: sequence_lines.append("CREATE SEQUENCE %s_id_seq" % (current_table)) - sequence_lines.append("SELECT setval('%s_id_seq', max(id)) FROM %s" % (current_table, current_table)) + sequence_lines.append("SELECT setval('%s_id_seq', max(id)) FROM \"%s\"" % (current_table, current_table)) sequence_lines.append("ALTER TABLE \"%s\" ALTER COLUMN \"id\" SET DEFAULT nextval('%s_id_seq')" % (current_table, current_table)) # Record it creation_lines.append('"%s" %s %s' % (name, type, extra))