Fixes PostgreSQL sequence manual resets (fix-up for d77e874)
See <https://www.postgresql.org/docs/current/datatype-oid.html>.
This commit is contained in:
parent
d77e87412d
commit
9e27a685a9
@ -181,7 +181,7 @@ BEFORE LOAD DO
|
||||
|
||||
AFTER LOAD DO
|
||||
$$ UPDATE pg_index SET indisready=true WHERE indrelid = (SELECT oid FROM pg_class WHERE relname = '{{ TARGET_TABLE }}'); $$,
|
||||
$$ SELECT setval("seq_{{ TARGET_TABLE }}_id", (SELECT MAX(id) FROM "{{ TARGET_TABLE }}")); $$;
|
||||
$$ SELECT setval('seq_{{ TARGET_TABLE }}_id', (SELECT MAX(id) FROM "{{ TARGET_TABLE }}")); $$;
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
It turns out PGLoader doesn't specify `CASCADE` when truncating target table, so we must do it ourselves as import prelude.
|
||||
|
Loading…
x
Reference in New Issue
Block a user