Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundle: can't import two bundles from csv in the same transaction #229

Open
erichanson opened this issue Dec 27, 2020 · 0 comments
Open
Labels

Comments

@erichanson
Copy link
Member

bundle.bundle_import_csv() fails when you try to import two bundles in the same transaction with:

aquameta=# begin;
BEGIN
aquameta=# select bundle.bundle_import_csv('/home/eric/dev/aquameta/bundles.private/com.getskeleton.library');
          bundle_import_csv           
--------------------------------------
 a5b6a97f-07af-4827-96d6-2ee7fa8ff8c7
(1 row)

aquameta=# select bundle.bundle_import_csv('/home/eric/dev/aquameta/bundles.private/org.aquameta.pwa');
ERROR:  relation "origin_temp" already exists
CONTEXT:  SQL statement "create temporary table origin_temp(id uuid, name text, head_commit_id uuid, checkout_commit_id uuid) on commit drop"
PL/pgSQL function bundle.bundle_import_csv(text) line 22 at EXECUTE

Looks like origin_temp gets cleaned up on commit if you're in a transaction. Audit and fix.

@erichanson erichanson added the bug label Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant