Skip to content

Rework backup & restore#1760

Open
brontolosone wants to merge 10 commits intogetodk:masterfrom
brontolosone:db-conf-and-db-backup-03
Open

Rework backup & restore#1760
brontolosone wants to merge 10 commits intogetodk:masterfrom
brontolosone:db-conf-and-db-backup-03

Conversation

@brontolosone
Copy link
Copy Markdown
Contributor

@brontolosone brontolosone commented Feb 26, 2026

Closes getodk/central#1646
Closes getodk/central#1639

Related: getodk/central#1736
Related: getodk/docs#2052

Implements a new backup format, and a new restore routine, per the proposal of getodk/central#1646 .

Notable:

  1. We won't produce the legacy .zip format anymore.
  2. We will still support restoring from it.
  3. But, we will restore from it in the improved way as outlined in Improved backup format (and DB dump/restore procedure) central#1646. This means users could be surprised that the baffling earlier behaviour is gone, and may need to adapt to that. See Improved backup format (and DB dump/restore procedure) central#1646.
  4. So we'll still have code for dealing with the legacy format around.
  5. To cordon off that legacy code, and make it easy to extirpate it when the time comes to stop supporting it, I moved things around to that end (modules, function naming).
  6. As restoring from legacy .zip is still supported in the codebase, reading that format is also still tested. But not in the backup-restore.sh e2e test. So the restore from that format through lib/bin/restore.js is not automatically tested anymore. I tested it manually 🤷‍♂️
  7. Anyway, for the automated tests for unzipping+decrypting, we need to have testing material. So we'll also still need either legacy .zip test data, or code to produce test data. I've chosen to move the legacy zip-producing code to the tests, because we have no desire for that code anymore in anything facing the user, it's only used in the tests, so that's where it should go.
  8. In lib/bin/restore.js content sniffing is used to distinguish between the old and new formats.
  9. For the new format we can, and will, error out very early, with a specific exit code, when the supplied passphrase is incorrect 🥳
  10. I didn't see what "tasks" were buying me, and found it sloppy how restore.js was writing to stdout yet actually was expected to return a task result or something to then be processed, or something, it all didn't make sense anymore and got in the way of actually effecting a process exit code, so I reorganized a bit there too. Throwing "Problem"s also didn't make sense to me here, nor does printing json { "success": true } to a terminal user, it felt like too many layers of old paint.
  11. Documentation for these changes and feature updates is tracked here.
  12. Introduces a new dependency: buffer-peek-stream. Looks solid, compatible license IIUC (MIT), no changes in 6 years (for a library, could mean it's finished and does the job!). We could write it ourselves if absolutely necessary 🤷‍♂️
  13. I have forgone verifying the backup in the integration tests, since we already have an e2e test covering the whole thing. 🤷‍♂️
  14. The e2e test tests whether a corrupted backup will be detected. It does so by lobbing off 1K from the end. I briefly tried to familiarize myself with the pg_dump binary format and it seems that sections are prefixed with sizes (thus pg_restore would notice a short read), and confirmed this with an experiment in which I tested lobbing off all possible truncations (1…file length) from a test pgdump to see if there is a way for pg_restore to accept it as valid even though it's truncated. There doesn't seem to be, which is nice for a backup format 👍, and very nice for us since it means the backups are verifiable, all the more important because they're streamed out and users may have half-a-downloaded-dump upon, for instance, a network error. The docs will contain info on how to verify backups.
  15. There's a test that asserts that an interrupted stream is recognizable as such.

What has been done to verify that this works as intended?

Tests

Why is this the best possible solution? Were any other approaches considered?

See getodk/central#1646

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Someone could be counting on, or have automated mitigations for, the legacy idiosyncratic (baffling and dangerous, under certain conditions) restore procedure, see getodk/central#1646 . So someone out there may be surprised that the restored database content actually ends up in the configured database rather than the database as recorded internally in the dump (which only incidentally could be the same as the name of the configured database).

Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.

Not the API docs, but tracking desire for user-facing documentation updates here.

Before submitting this PR, please make sure you have:

  • run make test and confirmed all checks still pass, or witnessed Github completing all checks with success
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch 7 times, most recently from 5dbf5c9 to d7015cd Compare February 27, 2026 14:55
@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch 7 times, most recently from ce77161 to 60c547a Compare February 27, 2026 16:23
@brontolosone brontolosone marked this pull request as ready for review February 27, 2026 16:46
@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch from 60c547a to 04cf75c Compare February 28, 2026 14:58
Copy link
Copy Markdown
Contributor

@sadiqkhoja sadiqkhoja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't finished the review, but here are my current comments/questions

Comment thread lib/util/backup-legacy.js
Comment thread test/e2e/standard/backup-restore.sh Outdated
Comment thread lib/util/backup.js Outdated
@sadiqkhoja
Copy link
Copy Markdown
Contributor

sadiqkhoja commented Mar 19, 2026

I tried running this PR locally and here are my observations:

  • When I started my server with a less privileged PG user who doesn't have rights to lock the entire table, and when I called /v1/backup endpoint, I got the 200 response and the downloaded file with Salted__Sc���툎 content. However, in the server logs I can see the error: pg_dump: error: query failed: ERROR: permission denied for table knex_migrations. This can be a dangerous problem, it will give user false sense of security that they have the backup but in reality they would have nothing. We need to return 4xx/5xx error in case of any problem.
  • While restoring I got bunch of errors like:
CREATE INDEX entity_defs_search_index ON public.entity_defs USING gin (((jsonb_to_tsvector('simple'::regconfig, data, '["string"]'::jsonb) || to_tsvector('simple'::regconfig, label)))) WHERE (current = true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entity_defs_sourceid_index ON public.entity_defs USING btree ("sourceId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX field_keys_actorid_projectid_index ON public.field_keys USING btree ("actorId", "projectId");
....

but I got the following message at the end:

Success. You will have to log out of the site, and then log back in.
    IMPORTANT: Everything has been restored to the way things were at the time of backup, including:
    * all passwords and email addresses.
    * anything deleted since the backup was made — such things now exist again.
    Please revisit all of these and make sure they are okay.

So I assumed all worked out fine. So I started my server and I couldn't logged in. When checked the DB, all of the tables were empty. The tables were actually created by knex migrations on the start of the server. My understanding is that my local database was in terrible shape when I took the backup and now while restoring it is causing some constraints failures. My concern is around the messaging, in those cases we shouldn't claim success.

  • Another test that failed. Created a backup with passphrase on master branch and then tried to restore it with this PR. Got following error:
node lib/bin/restore.js ~/freshbkOnMasterWithPP '123123'
Error: process exited with code: 1, spawnfile: pg_restore, args: pg_restore,--no-acl,--no-owner,--exit-on-error,--format,d,--file,-,/private/var/folders/6b/t9d6bf4j04z0_w8mvx8p88p80000gn/T/tmp-48370-YoScpOdHr44I
    at awaitSpawnee (/Users/sadiq/Repos/central-backend/lib/util/process.js:8:17)
    at async Promise.all (index 0)
    at async tmp.withDir.unsafeCleanup (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:55:5)
    at async Object.withDir (/Users/sadiq/Repos/central-backend/node_modules/tmp-promise/index.js:37:12)
    at async restoreFromLegacyZipFile (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:51:3)
    at async main (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:77:5) {
  exitcode: 1
}

Comment thread lib/util/backup.js Outdated
Comment thread lib/util/backup.js Outdated
stdio: ['pipe', 'pipe', 'inherit'],
},
);
pipeline(reconstitutedInput, spawned.stdin);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should .catch be added here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anything goes south with either of these two processes, we'll already hear from it because the process exit statuses are checked.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without .catch (this PR) when target database is missing:

% node lib/bin/restore.js ~/jubiliantApril13
restoreBackupFromRestoreStream
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  database "jubilant" does not exist
node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v24.13.0

with .catch(e => console.log('error occurred') (modifying the PR):

% node lib/bin/restore.js ~/jubiliantApril13
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  database "jubilant" does not exist
error occurred
Error: process exited with code: 2, spawnfile: psql, args: psql,--no-password,--no-psqlrc,--quiet,--echo-errors
    at awaitSpawnee (/Users/sadiq/Repos/central-backend/lib/util/process.js:8:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
    at async Promise.all (index 1)
    at async restoreFromEncryptedPgDumpStream (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:46:3)
    at async main (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:79:5) {
  exitcode: 2
}

Comment thread lib/util/backup-legacy.js Outdated
@matthew-white
Copy link
Copy Markdown
Member

@brontolosone, regression testing for v2026.1 will be starting soon, so this PR probably needs to get merged soon if it's to make it into the release. I'm thinking that it'd also be OK to ship with .2.

@lognaturel
Copy link
Copy Markdown
Member

@brontolosone touched base today and talked a little bit about this. I advocated for writing the backup to disk and then sending it over the wire to avoid any case where the backup might fail/truncate but the response code would be 200. We also agreed to get this into .2.

@brontolosone
Copy link
Copy Markdown
Contributor Author

This comment contains 3 claims.

First claim: "pg_dump can be made to stumble and fall, and then the stream will be truncated, but it started with the promise of a 200!".

Right off the bat: This is expected, HTTP is not transactional this way. Responses may be interrupted for any reason (server crashes, someone pulls the plug on the router, ...). This goes for the whole API, not just the /backup endpoint. As I currently understand it, ideally we'd abort the TCP connection with an RST, which should result in a network error from the clientside perspective, and then the client can take appropriate action. But it seems Node can't actually be made to do that.

That said, on to the specifics on how you made pg_dump stumble. It's a little vague what state was created, exactly, for instance, you say you created a DB user that cannot lock tables, but there is no specific privilege for locking tables, and it is only implicitly stated which table had been made unlockable.
So lacking details I just tried to repro by creating a user with all privileges on my Central DB, yet revoking the SELECT permission for the knex_migrations table for it.

Side note: This makes it impossible to start the server the docker-way or the make dev-way, we have to bypass running migrations by directly starting lib/bin/run-server.js instead. I think we can question to what extent it is reasonable to expect the backup function to work (in some capacity) when arbitrary things have been done to the database, and whether you can have a practical working Central installation yet trip up pg_dump. Do we hold one to another standard then the other? Not arguing for or against (yet), just saying that it helps if it's explicit.

Anyway. I can't repro exactly what you did, for wont of detail, but at least when I paraphrase your act of sabotage, this has the intended effect of making pg_dump stumble along the way:

pg_dump: error: query failed: ERROR:  permission denied for table knex_migrations
pg_dump: detail: Query was: COPY public.knex_migrations (id, name, batch, migration_time) TO stdout;

which leaves us an interrupted stream, evidenced by:

curl -H 'Accept: application/json, text/plain, */*' -H 'Authorization: Bearer blabla' -X POST http://127.0.0.1:8383/v1/backup | openssl enc -d -chacha20 -pbkdf2 -pass pass:'' | pg_restore -f /dev/null

pg_restore exits nonzero and reports pg_restore: error: could not read from input file: end of file, as expected.

So, my claim is, that in order to verify one's backups, one needs to run something similar to the above, for which I intend to write something in the docs.
There is nothing we can do serverside to 100% obviate this need. Thankfully it's simple, whereas with the original backup implementation (which also streamed) there was no way of verifying backups.
If someone does curl /someapi > somefile, there's nothing we can do serverside to make that somefile file disappear when someone pulls the plug on the router. Ideally we'd be able to raise a network error by sending an RST (which would make curl exit nonzero, hopefully, which could then inform further clientside action), but as I gathered and already mentioned, it seems Node can't actually be made to do that.

For the specific DB permissions sabotage from your scenario, and some similar scenarios, we could detect early whether the backup has a chance succeeding. For instance, we could do a test pg_dump run, just dumping to /dev/null; if it exits nonzero, we serve some 500, if it doesn't, we run pg_dump again and start the stream (having some hope that no one sabotaged the DB permissions in the small window between). Yet, still, someone can always pull the plug on the network, giving you a broken backup if you did some variant of curl /backup > somefile. So you'd still need to verify your backups!

There's one amendment that would slightly improve this situation (but not without downsides, listed below), which I discussed with @lognaturel last week: if we would spool the response to disk first, we can serve it out with a Content-Length header which then lets tools such as curl exit nonzero when streams abort: on stderr, curl reports curl: (18) end of response with 190 bytes missing (accompanied by status code 18, of which the meaning is, from its manpage: Partial file. Only a part of the file was transferred.). Also, if you'd download the backup with a browser (though note we don't offer UI around making a DB backup, though we could) you'd get a nice progress bar with ETA, thanks to that Content-Length header.
Downsides of this are:

  • inefficiency: we're not getting the data out ASAP
  • inefficiency: we'll take up (a potentially enormous amount of) temp disk space
  • configuration: we'll need to worry about where to spool to, as $TMPDIR may well be an in-memory filesystem
  • operationally: will we properly clean up the tempfile? even after a hard crash?
  • timeouts: if the spooling takes a long time, we may have to keep the connection alive somehow in the interim, otherwise an upstream reverse proxy could time us out.

All these were downsides/problems in the previous backup implementation, too. But note that that implementation didn't have the Content-Length header (as the backup zip was assembled on the fly), thus it had these downsides, but not the upside that this approach will give us.

@brontolosone
Copy link
Copy Markdown
Contributor Author

Second claim from the comment:

"I created a (broken) backup that upon restore, broke my database"

How you end up with a broken backup and the extent to which we can/should do anything about that has been discussed here.
This is about the claim that the restore process somehow mutates DB state, even if the backup is corrupt.
That would be awful, it's something the previous restore implementation did, and I set out to avoid it.

I cannot reproduce this.

If I take my broken backup created here and restore it, I get:

$ node lib/bin/restore.js /dev/shm/odktemp/broken.pgdump.enc        
pg_restore: error: could not read from input file: end of file
Error: process exited with code: 1, spawnfile: /bin/bash, args: /bin/bash,-c,openssl enc -d -pbkdf2 -pass env:ODK_BACKUP_PASSPHRASE -chacha20 | pg_restore --exit-on-error --no-owner --no-acl --file=-
    at awaitSpawnee (/home/boer/odkdev/central-backend/backup-reworked/lib/util/process.js:8:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async Promise.all (index 0)
    at async restoreFromEncryptedPgDumpStream (/home/boer/odkdev/central-backend/backup-reworked/lib/bin/restore.js:46:3)
    at async main (/home/boer/odkdev/central-backend/backup-reworked/lib/bin/restore.js:79:5) {
  exitcode: 1
}

And since everything's wrapped in a transaction, everything done up to the point where pg_restore has a short read, has been rolled back. I don't end up with a DB with empty tables like you say you did, nor do I get a happy success message.

Can you revisit your repro?

@brontolosone
Copy link
Copy Markdown
Contributor Author

I'm currently looking into, in the event of process errors, making chunked transport encoding not send the finalizing 0-length chunk header, to signal a broken stream. That's probably what we want as it would give an in-http client-detectable signal that an error has occurred.

@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch from cca2f1e to 2ff01d2 Compare March 30, 2026 05:09
@brontolosone
Copy link
Copy Markdown
Contributor Author

brontolosone commented Mar 30, 2026

See 120a812 which makes pg_dump errors manifest themselves as an error in the node-stream, resulting in a prematurely ended chunked-transport-encoded http stream, which are client-detectable; eg curl exits nonzero when downloading a backup for which pg_dump (or openssl for that matter) exited nonzero during the making of it.

I think this is a reasonable middle ground? "don't use the backup if your http library tells you the download was incomplete"? I can put it in the docs.

@lognaturel would you still like to have a mutex on concurrent backup runs, even though we're not using disk space? It still takes server CPU resources of course, but so does everything else.

@brontolosone
Copy link
Copy Markdown
Contributor Author

Claim 3:

Another test that failed. Created a backup with passphrase on master branch and then tried to restore it with this PR. Got following error:

I can't repro that 😿
What are the versions of your pg_dump, pg_restore, and your psql -c 'select version();' yourcentraldb ? And your type -a pg_dump, type -a pg_restore ?

@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch from 8432916 to 51e4221 Compare March 30, 2026 05:49
@brontolosone
Copy link
Copy Markdown
Contributor Author

brontolosone commented Mar 30, 2026

See 120a812 which makes pg_dump errors manifest themselves as an error in the node-stream, resulting in a prematurely ended chunked-transport-encoded http stream, which are client-detectable; eg curl exits nonzero when downloading a backup for which pg_dump (or openssl for that matter) exited nonzero during the making of it.

Sadly, nginx as a reverse proxy un-chunks it, and apparently isn't alarmed by the short read. I'm going to have a look to see if that can be amended.

@brontolosone
Copy link
Copy Markdown
Contributor Author

See 120a812 which makes pg_dump errors manifest themselves as an error in the node-stream, resulting in a prematurely ended chunked-transport-encoded http stream, which are client-detectable; eg curl exits nonzero when downloading a backup for which pg_dump (or openssl for that matter) exited nonzero during the making of it.

Sadly, nginx as a reverse proxy un-chunks it, and apparently isn't alarmed by the short read. I'm going to have a look to see if that can be amended.

easily solved by adding proxy_http_version 1.1 to the nginx config.

@brontolosone brontolosone requested a review from sadiqkhoja March 31, 2026 05:00
@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch from cd2b7de to fa85d3e Compare March 31, 2026 07:06
Comment thread lib/bin/restore.js
@brontolosone
Copy link
Copy Markdown
Contributor Author

@brontolosone touched base today and talked a little bit about this. I advocated for writing the backup to disk and then sending it over the wire to avoid any case where the backup might fail/truncate but the response code would be 200. We also agreed to get this into .2.

Even if you prep the whole file serverside beforehand, while streaming it out, the stream might still break halfway. Chunked transfer encoding is the answer. And once you have that, then why entertain the downsides of using temp storage — just stream all the way.
And thus the current iteration doesn't use temp storage.

@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch 3 times, most recently from b75ae25 to 769e45b Compare April 12, 2026 22:39
@lognaturel
Copy link
Copy Markdown
Member

@lognaturel would you still like to have a mutex on concurrent backup runs, even though we're not using disk space?

No, let's not.

@brontolosone
Copy link
Copy Markdown
Contributor Author

Related: the documentation amendments and additions with following this PR, are in PR getodk/docs#2052 . They may give the reviewer yet more context :-)

Comment thread lib/util/backup.js Outdated
Comment thread lib/bin/restore.js Outdated
Comment thread lib/util/backup.js Outdated
stdio: ['pipe', 'pipe', 'inherit'],
},
);
pipeline(reconstitutedInput, spawned.stdin);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without .catch (this PR) when target database is missing:

% node lib/bin/restore.js ~/jubiliantApril13
restoreBackupFromRestoreStream
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  database "jubilant" does not exist
node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v24.13.0

with .catch(e => console.log('error occurred') (modifying the PR):

% node lib/bin/restore.js ~/jubiliantApril13
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  database "jubilant" does not exist
error occurred
Error: process exited with code: 2, spawnfile: psql, args: psql,--no-password,--no-psqlrc,--quiet,--echo-errors
    at awaitSpawnee (/Users/sadiq/Repos/central-backend/lib/util/process.js:8:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
    at async Promise.all (index 1)
    at async restoreFromEncryptedPgDumpStream (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:46:3)
    at async main (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:79:5) {
  exitcode: 2
}

@sadiqkhoja
Copy link
Copy Markdown
Contributor

That said, on to the specifics on how you made pg_dump stumble. It's a little vague what state was created, exactly, for instance, you say you created a DB user that cannot lock tables, but there is no specific privilege for locking tables, and it is only implicitly stated which table had been made unlockable.
So lacking details I just tried to repro by creating a user with all privileges on my Central DB, yet revoking the SELECT permission for the knex_migrations table for it.

In my case, owner of knex_migrations was some other user and the current user didn't even have SELECT permission. And because I was using pg_dump v17.5 I was getting following error:

Error

pg_dump: error: query failed: ERROR:  permission denied for table knex_migrations
pg_dump: detail: Query was: LOCK TABLE public.knex_migrations, public.knex_migrations_lock, public.forms, public.submissions, public.actees, public.actors, public.users, public.sessions, public.audits, public.field_keys, public.blobs, public.submission_attachments, public.config, public.form_attachments, public.projects, public.roles, public.assignments, public.form_defs, public.submission_defs, public.keys, public.client_audits, public.form_fields, public.public_links, public.comments, public.form_field_values, public.datasets, public.ds_properties, public.ds_property_fields, public.entities, public.entity_defs, public.dataset_form_defs, public.form_schemas, public.entity_def_sources, public.entity_submission_backlog, public.user_site_preferences, public.user_project_preferences, public.purged_entities, public.submission_field_extract_geo_cache, public.current_event IN ACCESS SHARE MODE

So two things went wrong: 1) I was using user with insufficient privilege 2) a different pg_dump version (maybe it's okay to use pg_dump 17 🤷‍♂️). I agree with your sidenote about docker-way, so both of the issues won't be happening in real world or if they do then we don't really need to support them. I am sharing these detail in case you are curious about them. For me, all of these are not so much important. My concern was around informing clients about the failure and the explanation you provided around HTTP is satisfactory to me.

Now the solution you have proposed of sending Null chunk to signal broken stream is perfect but I couldn't verify it locally, maybe I'm doing something wrong (should we setup a call?):

Curl never terminates in case of backend error

In the nginx logs, I see:

12:27:52 PM nginx.1 |  2026/04/14 12:27:52 [error] 21851#0: *1 upstream prematurely closed connection while reading upstream, client: 127.0.0.1, server: localhost, request: "POST /v1/backup HTTP/1.1", upstream: "http://[::1]:8383/v1/backup", host: "localhost:8686"

nginx version:

nginx version: nginx/1.29.8

central-frontend/nginx-conf/main.conf diff:

diff --git a/nginx-conf/main.conf b/nginx-conf/main.conf
index 6e69927c..5e2247ec 100644
--- a/nginx-conf/main.conf
+++ b/nginx-conf/main.conf
@@ -63,6 +63,7 @@ http {
 
   server {
     listen 8686;
+    http2 on;
     server_name localhost;
 
     server_tokens off;
@@ -125,6 +126,7 @@ http {
       proxy_request_buffering on;
       proxy_buffering off;
       proxy_read_timeout 2m;
+      proxy_http_version 1.1;
 
       # Dev-specific hacks:

Curl version:

% curl --version
curl 8.19.0 (aarch64-apple-darwin24.6.0) libcurl/8.19.0 OpenSSL/3.6.1 zlib/1.2.12 brotli/1.2.0 zstd/1.5.7 AppleIDN libssh2/1.11.1 nghttp2/1.68.1 ngtcp2/1.22.0 nghttp3/1.15.0 mit-krb5/1.7-prerelease OpenLDAP/2.4.28/Apple
Release-Date: 2026-03-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt mqtts pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AppleSecTrust AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

Repro of second issue reported earlier:

  • Create a new target database without the required extensions i.e. citext, pg_trgm, pgrowlocks
  • node lib/bin/restore.js ~/jubiliantApril13 > output.log 2>&1
output.log
ERROR:  permission denied to create extension "citext"
HINT:  Must have CREATE privilege on current database to create this extension.
STATEMENT:  CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON EXTENSION citext IS 'data type for case-insensitive character strings';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE EXTENSION IF NOT EXISTS pgrowlocks WITH SCHEMA public;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON EXTENSION pgrowlocks IS 'show row-level locking information';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TYPE public."conflictType" AS ENUM (
    'soft',
    'hard'
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TYPE public.s3_upload_status AS ENUM (
    'pending',
    'uploaded',
    'failed',
    'skipped'
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.blank_submissions_event_triggerfunction() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
        BEGIN
            NEW.event = NULL;
            RETURN NEW;
        END;
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.blank_submissions_event_triggerfunction() IS '{"dbsamizdat": {"version": 1, "definition_hash": "0982b1119302eb5c8afe455903c5ec8a"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.cache_all_submission_geo(only_default_path boolean DEFAULT false, batchsize integer DEFAULT NULL::integer) RETURNS integer[]
    LANGUAGE sql
    AS $$
    WITH extraction_todo AS (
        SELECT
            sdef.id as submission_def_id,
            ffgeo.fieldhash,
            ffgeo.type as geotype,
            ffgeo.repeatgroup_cardinality > 0 as isrepeatable,
            ffgeo.path as fieldpath
        FROM
            submission_defs sdef
            INNER JOIN form_defs fdef ON
                sdef.current
                AND
                (fdef.id = sdef."formDefId")
            INNER JOIN form_field_geo ffgeo ON
                (ffgeo.formschema_id = fdef."schemaId")
                AND (
                    (only_default_path = false)
                    OR
                    (ffgeo.is_default)
                )
            -- determine outstanding work by left-joining to the cache table
            LEFT OUTER JOIN submission_field_extract_geo_cache cache ON
                (sdef.id, ffgeo.fieldhash) = (cache.submission_def_id, cache.fieldhash)
        WHERE
            cache.submission_def_id IS NULL  -- therefor, uncached.
    ),
    extraction_todo_count AS MATERIALIZED (
        SELECT
            count(*) as todo_cnt
        FROM
            extraction_todo
    ),
    newly_extracted AS (
        SELECT
            submission_def_id,
            fieldhash,
            extract_submission_geo(
                geotype,
                isrepeatable,
                fieldpath,
                safe_to_xml(sdef.xml)
            ) AS geovalue
        FROM
            extraction_todo
            INNER JOIN submission_defs sdef ON (extraction_todo.submission_def_id = sdef.id)
        LIMIT batchsize
    ),
    newly_inserted AS (
        INSERT INTO submission_field_extract_geo_cache (
            SELECT
                *
            FROM
                newly_extracted
        )
        ON CONFLICT DO NOTHING
        RETURNING 1
    ),
    newly_inserted_count AS MATERIALIZED (
        SELECT
            count(*) as ins_cnt
        FROM
            newly_inserted
    )
    SELECT
        ARRAY[ins_cnt, todo_cnt - ins_cnt]
    FROM
        extraction_todo_count, newly_inserted_count
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.cache_all_submission_geo(only_default_path boolean, batchsize integer) IS '{"dbsamizdat": {"version": 1, "definition_hash": "406edd1dbf8a7a2e1bd0e4ea45542978"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.check_email() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  declare extant int;
  begin
    select count(*) into extant from users inner join
      (select id from actors where "deletedAt" is null and id != NEW."actorId")
        as actors on actors.id=users."actorId"
      where email=NEW.email limit 1;
    if extant > 0 then
      raise exception 'ODK01:%', NEW.email;
    end if;
    return NEW;
  end;
$$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.check_field_collisions() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  declare extant int;
  declare extformid int;
  declare extpath text;
  declare exttype text;
  begin
    -- factoring the repeated joins here into a CTE explodes the cost by 10x

    select count(distinct type), form_fields."formId", form_fields.path into extant, extformid, extpath
      from form_fields

      -- finds canonical formDefIds (published, or active draft)
      left outer join (select id from form_defs where "publishedAt" is not null) as form_defs
        on form_defs.id = form_fields."formDefId"
      left outer join (select id, "draftDefId" from forms) as forms
        on forms."draftDefId" = form_fields."formDefId"

      -- weeds out paths whose latest def indicates they are a string. first figure
      -- out latest def, then knock out latest strings from conflict detection.
      inner join
        (select form_fields."formId", max("formDefId") as "latestDefId" from form_fields
          -- this is a repeat of the above canonical-def subquery
          left outer join (select id from form_defs where "publishedAt" is not null) as ifds
            on ifds.id = form_fields."formDefId"
          left outer join (select id, "draftDefId" from forms) as ifs
            on ifs."draftDefId" = form_fields."formDefId"
          where ifs.id is not null or ifds.id is not null
          group by form_fields."formId"
        ) as tail
        on tail."formId" = form_fields."formId"
      inner join
        (select "formDefId", path from form_fields where type != 'string') as nonstring
        on "latestDefId" = nonstring."formDefId" and form_fields.path = nonstring.path

      where forms.id is not null or form_defs.id is not null
      group by form_fields."formId", form_fields.path having count(distinct type) > 1;

    if extant > 0 then
      select type into exttype
        from form_fields
        where "formId" = extformid and path = extpath
        order by "formDefId" desc
        limit 1
        offset 1;

      raise exception using message = format('ODK05:%s:%s', extpath, exttype);
    end if;

    return NEW;
  end;
$$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.check_form_state() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  begin
    if NEW.state is null or NEW.state not in ('open', 'closing', 'closed') then
      raise exception 'ODK03:%', NEW.state;
    end if;
    return NEW;
  end;
$$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.check_form_version() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  declare extant int;
  declare pid int;
  declare xmlid text;
  declare vstr text;
  begin
    select count(*), "projectId", "xmlFormId", version into extant, pid, xmlid, vstr
      from form_defs
      inner join (select id, "xmlFormId", "projectId" from forms)
        as forms on forms.id = form_defs."formId"
      where "publishedAt" is not null
      group by "projectId", "xmlFormId", version
      having count(form_defs.id) > 1;

    if extant > 0 then
      raise exception using message = format('ODK02:%s:%L:%L', pid, xmlid, vstr);
    end if;

    return NEW;
  end;
$$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.check_instanceid_unique() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  declare fid int;
  declare drft boolean;
  declare found int;
  begin
    select "formId", draft into fid, drft from submissions where submissions.id=NEW."submissionId";
    select count(*) into found from submissions
      join submission_defs on submissions.id=submission_defs."submissionId"
      where "formId"=fid and submission_defs."instanceId"=NEW."instanceId" and draft=drft;

    if found > 1 then
      raise exception using message = format('ODK06:%s', NEW."instanceId");
    end if;

    return NEW;
  end;
$$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.check_managed_key() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  declare "projectKeyId" int;
  begin
    select "keyId" into "projectKeyId" from forms
      inner join projects on projects.id = forms."projectId"
      where forms.id = NEW."formId";
    if "projectKeyId" is not null and NEW."keyId" is null then
      raise exception 'ODK04';
    end if;
    return NEW;
  end;
$$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.check_review_state() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  begin
    if NEW."reviewState" is not null and NEW."reviewState" not in ('hasIssues', 'edited', 'approved', 'rejected') then
      raise exception 'ODK03:%', NEW."reviewState";
    end if;
    return NEW;
  end;
$$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.eventstamp_submissions_triggerfunction() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
        BEGIN
            -- as this is called from a constraint trigger, we can't modify the data through modification of NEW.
            UPDATE submissions SET event = get_event() WHERE id = NEW.id;
            RETURN NEW;
        END;
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.eventstamp_submissions_triggerfunction() IS '{"dbsamizdat": {"version": 1, "definition_hash": "9af0a3a329872908cdf8ad0e7fc34efd"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.extract_submission_geo(odktype text, isrepeatable boolean, fieldpath text, submission_body xml) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
    SELECT
        odk2geojson_dispatch(
            odktype,
            isrepeatable,
            (SELECT
                xpath(
                    format(
                        '/*[1]%s[string-length(text()) > 0]/text()',
                        fieldpath
                    ),
                    submission_body
                )
            )::text[]
        )
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.extract_submission_geo(odktype text, isrepeatable boolean, fieldpath text, submission_body xml) IS '{"dbsamizdat": {"version": 1, "definition_hash": "1e047cc6db5af6f308d980c174f4cc58"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.get_event() RETURNS bigint
    LANGUAGE sql
    AS $$
        -- Locks out invocations in other transactions until this transaction commits.
        -- Use at the end of a transaction (the idea is to use this in a deferred constraint trigger).

        WITH current_event_locked AS (
            SELECT event FROM current_event
            FOR UPDATE
        ),

        new_event AS (
            UPDATE current_event
            SET event = event + 1
            RETURNING event
        )

        SELECT event FROM new_event

    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.get_event() IS '{"dbsamizdat": {"version": 1, "definition_hash": "9538082b3636013895e4dcc8de1165bb"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.hash_aggregate_state_transition_func(state text, additional_value anyelement) RETURNS text
    LANGUAGE sql IMMUTABLE PARALLEL SAFE
    AS $$
        SELECT md5(
            state
            ||
            coalesce(
                -- the below inner md5() is superfluous for what we need, but first reducing `additional_value` a string of length 32 bytes with md5()
                -- avoids allocating an unbounded size (if `additional_value` is large) intermediate buffer as an input to the enveloping md5().
                -- Yet with this inner md5() in place, no more than 64 bytes need to be allocated.
                md5(additional_value::text),
                '----'
            )
        )
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.hash_aggregate_state_transition_func(state text, additional_value anyelement) IS '{"dbsamizdat": {"version": 1, "definition_hash": "e96d80adec172b164c977ffa51e46342"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.hash_text(VARIADIC inputs text[]) RETURNS character varying
    LANGUAGE sql IMMUTABLE PARALLEL SAFE
    AS $$
        WITH hashed_inputs (hashed) AS (
            SELECT
                md5(unnest(inputs))
        )
        SELECT
            -- Note that string_agg drops NULLs, hence the coalesce(), of which the supplied NULL-replacement
            -- value must never collide with an md5 hash.
            -- Thus 'X' is a good choice, 'd41d8cd98f00b204e9800998ecf8427e' isn't.
            md5(string_agg(coalesce(hashed, 'X'), ' '))
        FROM
            hashed_inputs
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.hash_text(VARIADIC inputs text[]) IS '{"dbsamizdat": {"version": 1, "definition_hash": "007e5c12e860dba768d44b73884cb6d7"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.hash_text_to_bigint(VARIADIC inputs text[]) RETURNS bigint
    LANGUAGE sql IMMUTABLE PARALLEL SAFE
    AS $$
        SELECT ('x' || ("public"."hash_text"(VARIADIC inputs)))::bit(64)::bigint
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.hash_text_to_bigint(VARIADIC inputs text[]) IS '{"dbsamizdat": {"version": 1, "definition_hash": "d5d919010c84efbfc5218f7e85dca34e"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_dispatch(odktype text, isrepeatable boolean, fieldvalues text[]) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        SELECT
            CASE
                WHEN array_length(fieldvalues, 1) IS NOT NULL THEN
                    CASE isrepeatable
                        WHEN false THEN
                            CASE odktype
                                WHEN 'geopoint' THEN odk2geojson_point(fieldvalues[1])
                                WHEN 'geotrace' THEN odk2geojson_linestring(fieldvalues[1])
                                WHEN 'geoshape' THEN odk2geojson_polygon(fieldvalues[1])
                            END
                        WHEN true THEN
                            CASE odktype
                                WHEN 'geopoint' THEN odk2geojson_multipoint(fieldvalues)
                                WHEN 'geotrace' THEN odk2geojson_multilinestring(fieldvalues)
                                WHEN 'geoshape' THEN odk2geojson_multipolygon(fieldvalues)
                            END
                    END
            END
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_dispatch(odktype text, isrepeatable boolean, fieldvalues text[]) IS '{"dbsamizdat": {"version": 1, "definition_hash": "9563da45e3ece655061e8348162f8b31"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_ducktyped(odkgeosomething text) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH lineated AS (
            SELECT odk2geojson_helper_linestring(odkgeosomething, 1) as theline
        )
        SELECT
            CASE
                WHEN
                    theline IS NULL
                THEN
                    NULL
                WHEN
                    json_array_length(theline) = 1
                THEN
                    json_build_object('type', 'Point', 'coordinates', theline -> 0)
                WHEN
                    json_array_length(theline) > 3 AND ((theline::jsonb) -> 0 = (theline::jsonb) -> -1)
                THEN
                    json_build_object('type', 'Polygon', 'coordinates', json_build_array(theline))
                ELSE
                    json_build_object('type', 'LineString', 'coordinates', theline)
            END
        FROM lineated
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_ducktyped(odkgeosomething text) IS '{"dbsamizdat": {"version": 1, "definition_hash": "b39f6eed4f671d5be7f3bf37d13c10c5"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_helper_linestring(odkgeotrace text, min_length integer DEFAULT 2) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH pointillism AS MATERIALIZED (
            SELECT
                odk2geojson_helper_point(
                    unnest(
                        regexp_split_to_array(
                            odkgeotrace,
                            '\s*;\s*'
                        )
                    )
                ) as thepoint
        )
        SELECT
            CASE
                WHEN (
                    SELECT
                        EXISTS (
                            SELECT
                                1
                            FROM
                                pointillism
                            WHERE
                                thepoint IS NULL
                            )
                )
                THEN
                    NULL  -- One of the points is invalid
                WHEN (
                    SELECT
                        COUNT(*) < min_length
                    FROM
                        pointillism
                )
                THEN
                    NULL  -- Linestring not long enough
                ELSE
                    json_agg(thepoint)
            END
        FROM
            pointillism
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_helper_linestring(odkgeotrace text, min_length integer) IS '{"dbsamizdat": {"version": 1, "definition_hash": "2bfe4f9ba41bfb0fef430d09761ac0a8"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_helper_point(odkgeopoint text) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $_$
        WITH numextracted AS (
            SELECT
                regexp_match(odkgeopoint, '^\s*(-?(?:0|[1-9]\d?)(?:\.\d+)?)\s+(-?(?:0|[1-9]\d{0,2})(?:\.\d+)?)(?:\s+(-?(?:0|[1-9]\d*)(?:\.\d+)?))?(?:\s+(?:(?:0|[1-9]\d*)(?:\.\d+)?))?\s*$') AS nums
        ),
        numnumeric AS (
            -- ODK is lat, lon
            SELECT
                (nums[1])::numeric as lat,
                (nums[2])::numeric as lon,
                (nums[3])::numeric as alt
            FROM numextracted
        )
        SELECT
            (
                -- at this point: the array is either NULL, or contains two numberish
                -- strings followed by either NULL or another numberish string
                CASE
                    -- regexp didn't match
                    WHEN numextracted.nums IS NULL THEN
                        NULL
                    -- validate latitude
                    WHEN numnumeric.lat NOT BETWEEN -90 AND 90 THEN
                        NULL
                    -- validate longitude
                    WHEN numnumeric.lon NOT BETWEEN -180 AND 180 THEN
                        NULL
                    -- valid but no altitude supplied
                    WHEN numextracted.nums[3] IS NULL THEN
                        json_build_array(numnumeric.lon, numnumeric.lat)  -- geojson is lon, lat
                    -- the best outcome; lat, lon and altitude
                    ELSE
                        json_build_array(numnumeric.lon, numnumeric.lat, numnumeric.alt)  -- geojson is lon, lat
                END) AS thepoint
        FROM
            numextracted, numnumeric
    $_$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_helper_point(odkgeopoint text) IS '{"dbsamizdat": {"version": 1, "definition_hash": "0981da86dd07632b9f3907b21ba50938"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_helper_polygon(odkgeoshape text) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH lineated AS (
            SELECT odk2geojson_helper_linestring(odkgeoshape, 4) as theline
        )
        SELECT
            CASE
                WHEN
                    theline IS NULL
                THEN
                    NULL
                WHEN
                    (theline::jsonb)[0] IS DISTINCT FROM (theline::jsonb)[-1]
                THEN
                    NULL  -- first point doesn't match last point; not a polygon
                ELSE
                    json_build_array(theline)  -- a polygon goes into an array, the first (and in the odk case, only) polygon is the outer one, the optional next one is the inner one
            END
        FROM lineated
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_helper_polygon(odkgeoshape text) IS '{"dbsamizdat": {"version": 1, "definition_hash": "82d01fc92cd4c473f34b915173976efe"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_linestring(odkgeotrace text) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH lineated AS (
            SELECT odk2geojson_helper_linestring(odkgeotrace, 2) as theline
        )
        SELECT
            CASE
                WHEN
                    theline IS NULL
                THEN
                    NULL
                ELSE
                    json_build_object(
                        'type',
                        'LineString',
                        'coordinates',
                        theline
                    )
            END
        FROM lineated
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_linestring(odkgeotrace text) IS '{"dbsamizdat": {"version": 1, "definition_hash": "45bbba22d115bc6a0e3d93ce47ffa5b6"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_multilinestring(odkgeo text[]) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH agged AS (
            WITH geofied AS (
                SELECT
                    odk2geojson_helper_linestring(unnest(odkgeo)) AS geojson
            )
            SELECT
                json_agg(geojson) as agg
            FROM
                geofied
            WHERE
                geojson IS NOT NULL
        )
        SELECT
            CASE
                WHEN
                    agg IS NULL
                THEN
                    NULL
                ELSE
                    json_build_object(
                        'type',
                        'MultiLineString',
                        'coordinates',
                        agg
                    )
            END
        FROM
            agged
        $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_multilinestring(odkgeo text[]) IS '{"dbsamizdat": {"version": 1, "definition_hash": "138c14f9abd4f61206ed1566fed7d64f"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_multipoint(odkgeo text[]) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH agged AS (
            WITH geofied AS (
                SELECT
                    odk2geojson_helper_point(unnest(odkgeo)) AS geojson
            )
            SELECT
                json_agg(geojson) as agg
            FROM
                geofied
            WHERE
                geojson IS NOT NULL
        )
        SELECT
            CASE
                WHEN
                    agg IS NULL
                THEN
                    NULL
                ELSE
                    json_build_object(
                        'type',
                        'MultiPoint',
                        'coordinates',
                        agg
                    )
            END
        FROM
            agged
        $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_multipoint(odkgeo text[]) IS '{"dbsamizdat": {"version": 1, "definition_hash": "e0025adb6d892205c360e3af110a9f10"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_multipolygon(odkgeo text[]) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH agged AS (
            WITH geofied AS (
                SELECT
                    odk2geojson_helper_polygon(unnest(odkgeo)) AS geojson
            )
            SELECT
                json_agg(geojson) as agg
            FROM
                geofied
            WHERE
                geojson IS NOT NULL
        )
        SELECT
            CASE
                WHEN
                    agg IS NULL
                THEN
                    NULL
                ELSE
                    json_build_object(
                        'type',
                        'MultiPolygon',
                        'coordinates',
                        agg
                    )
            END
        FROM
            agged
        $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_multipolygon(odkgeo text[]) IS '{"dbsamizdat": {"version": 1, "definition_hash": "74bd019e8898ca644a6265eaac9bf114"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_point(odkgeopoint text) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH pointified AS (
            SELECT odk2geojson_helper_point(odkgeopoint) AS thepoint
        )
        SELECT
            CASE WHEN thepoint IS NULL THEN
                NULL
            ELSE
                json_build_object(
                    'type',
                    'Point',
                    'coordinates',
                    thepoint
                )
            END
        FROM pointified
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_point(odkgeopoint text) IS '{"dbsamizdat": {"version": 1, "definition_hash": "a294add1603d60f6ba6ad895ddb7a948"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.odk2geojson_polygon(odkgeoshape text) RETURNS json
    LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
    AS $$
        WITH polygonated AS (
            SELECT odk2geojson_helper_polygon(odkgeoshape) as thepolygon
        )
        SELECT
            CASE
                WHEN
                    thepolygon IS NULL
                THEN
                    NULL
                ELSE
                    json_build_object(
                        'type',
                        'Polygon',
                        'coordinates',
                        thepolygon
                    )
            END
        FROM polygonated
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.odk2geojson_polygon(odkgeoshape text) IS '{"dbsamizdat": {"version": 1, "definition_hash": "4768ee052c2cc289f29d20d0950f33f7"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE FUNCTION public.safe_to_xml(input text) RETURNS xml
    LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE
    AS $$
    DECLARE hopefully_xml xml DEFAULT NULL;
    BEGIN
        BEGIN
            hopefully_xml := input::xml;
        EXCEPTION WHEN OTHERS THEN
            RETURN NULL;
        END;
    RETURN hopefully_xml;
    END;
    $$;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON FUNCTION public.safe_to_xml(input text) IS '{"dbsamizdat": {"version": 1, "definition_hash": "a78eb90e2eeca40d1abc101185fb95c0"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE AGGREGATE public.md5_hash_agg(anyelement) (
    SFUNC = public.hash_aggregate_state_transition_func,
    STYPE = text,
    SSPACE = 32,
    INITCOND = '00000000000000000000000000000000'
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SET default_tablespace = '';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SET default_table_access_method = heap;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.actees (
    id character varying(36) NOT NULL,
    species character varying(36),
    parent character varying(36),
    "purgedAt" timestamp(3) with time zone,
    "purgedName" text,
    details jsonb
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.actors (
    id integer NOT NULL,
    type character varying(15),
    "acteeId" character varying(36) NOT NULL,
    "displayName" character varying(64) NOT NULL,
    meta jsonb,
    "createdAt" timestamp(3) with time zone,
    "updatedAt" timestamp(3) with time zone,
    "deletedAt" timestamp(3) with time zone,
    "expiresAt" timestamp(3) with time zone
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.actors_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.actors_id_seq OWNED BY public.actors.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.assignments (
    "actorId" integer NOT NULL,
    "roleId" integer NOT NULL,
    "acteeId" character varying(36) NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.audits (
    "actorId" integer,
    action text NOT NULL,
    "acteeId" character varying(36),
    details jsonb,
    "loggedAt" timestamp(3) with time zone,
    claimed timestamp(3) with time zone,
    processed timestamp(3) with time zone,
    "lastFailure" timestamp(3) with time zone,
    failures integer DEFAULT 0,
    id integer NOT NULL,
    notes text
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.audits_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.audits_id_seq OWNED BY public.audits.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.blobs (
    id integer NOT NULL,
    sha character varying(40) NOT NULL,
    content bytea,
    "contentType" text DEFAULT 'application/octet-stream'::text NOT NULL,
    md5 character varying(32) NOT NULL,
    s3_status public.s3_upload_status DEFAULT 'pending'::public.s3_upload_status NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.blobs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.blobs_id_seq OWNED BY public.blobs.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.client_audits (
    "blobId" integer NOT NULL,
    event text,
    node text,
    start text,
    "end" text,
    latitude text,
    longitude text,
    accuracy text,
    "old-value" text,
    "new-value" text,
    remainder jsonb,
    "user" text,
    "change-reason" text
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.comments (
    id integer NOT NULL,
    "submissionId" integer NOT NULL,
    "actorId" integer NOT NULL,
    body text NOT NULL,
    "createdAt" timestamp(3) with time zone
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.comments_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.comments_id_seq OWNED BY public.comments.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.config (
    key character varying(40) NOT NULL,
    value jsonb,
    "setAt" timestamp(3) with time zone,
    "blobId" integer
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.current_event (
    event bigint NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.dataset_form_defs (
    "datasetId" integer NOT NULL,
    "formDefId" integer NOT NULL,
    actions jsonb NOT NULL,
    path text DEFAULT '/'::text NOT NULL,
    "isRepeat" boolean DEFAULT false NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.datasets (
    id integer NOT NULL,
    name text NOT NULL,
    "acteeId" character varying(36) NOT NULL,
    "createdAt" timestamp(3) with time zone NOT NULL,
    "projectId" integer NOT NULL,
    "publishedAt" timestamp(3) with time zone,
    "approvalRequired" boolean DEFAULT false NOT NULL,
    "ownerOnly" boolean DEFAULT false NOT NULL,
    "deletedAt" timestamp(3) with time zone
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.datasets_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.datasets_id_seq OWNED BY public.datasets.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.ds_properties (
    id integer NOT NULL,
    name text NOT NULL,
    "datasetId" integer NOT NULL,
    "publishedAt" timestamp(3) with time zone,
    "deletedAt" timestamp(3) with time zone
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.ds_properties_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.ds_properties_id_seq OWNED BY public.ds_properties.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.ds_property_fields (
    "dsPropertyId" integer,
    "formDefId" integer,
    path text
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.entities (
    id integer NOT NULL,
    uuid uuid NOT NULL,
    "datasetId" integer NOT NULL,
    "createdAt" timestamp(3) with time zone NOT NULL,
    "creatorId" integer NOT NULL,
    "updatedAt" timestamp(3) with time zone,
    "deletedAt" timestamp(3) with time zone,
    conflict public."conflictType"
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.entities_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.entities_id_seq OWNED BY public.entities.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.entity_def_sources (
    id integer NOT NULL,
    type character varying(36) NOT NULL,
    "auditId" integer,
    "submissionDefId" integer,
    details jsonb,
    "forceProcessed" boolean
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.entity_def_sources_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.entity_def_sources_id_seq OWNED BY public.entity_def_sources.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.entity_defs (
    id integer NOT NULL,
    "entityId" integer NOT NULL,
    "createdAt" timestamp(3) with time zone NOT NULL,
    current boolean,
    data jsonb NOT NULL,
    "creatorId" integer NOT NULL,
    "userAgent" character varying(255),
    label text NOT NULL,
    root boolean DEFAULT false NOT NULL,
    "sourceId" integer,
    version integer DEFAULT 1 NOT NULL,
    "dataReceived" jsonb DEFAULT '{}'::jsonb NOT NULL,
    "baseVersion" integer,
    "conflictingProperties" jsonb,
    "branchId" uuid,
    "trunkVersion" integer,
    "branchBaseVersion" integer
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.entity_defs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.entity_defs_id_seq OWNED BY public.entity_defs.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.entity_submission_backlog (
    "submissionId" integer NOT NULL,
    "submissionDefId" integer NOT NULL,
    "branchId" uuid NOT NULL,
    "branchBaseVersion" integer NOT NULL,
    "loggedAt" timestamp(3) with time zone NOT NULL,
    "auditId" integer NOT NULL,
    "entityUuid" uuid NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.field_keys (
    "actorId" integer NOT NULL,
    "createdBy" integer NOT NULL,
    "projectId" integer
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.form_attachments (
    "formId" integer NOT NULL,
    "blobId" integer,
    name text NOT NULL,
    type text,
    "formDefId" integer NOT NULL,
    "updatedAt" timestamp(3) with time zone,
    "datasetId" integer,
    CONSTRAINT "check_blobId_or_datasetId_is_null" CHECK ((("blobId" IS NULL) OR ("datasetId" IS NULL))),
    CONSTRAINT "check_datasetId_is_null_for_non_file" CHECK (((type = 'file'::text) OR ("datasetId" IS NULL)))
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.form_defs (
    id integer NOT NULL,
    "formId" integer,
    xml text NOT NULL,
    hash character varying(32) NOT NULL,
    sha character varying(40) NOT NULL,
    sha256 character varying(64) NOT NULL,
    version text NOT NULL,
    "createdAt" timestamp(3) with time zone,
    "keyId" integer,
    "xlsBlobId" integer,
    "publishedAt" timestamp(3) with time zone,
    "draftToken" character varying(64),
    "enketoId" character varying(255),
    name text,
    "schemaId" integer
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.form_defs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.form_defs_id_seq OWNED BY public.form_defs.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.form_fields (
    "formId" integer NOT NULL,
    path text NOT NULL,
    name text NOT NULL,
    type character varying(32) NOT NULL,
    "binary" boolean,
    "order" integer NOT NULL,
    "selectMultiple" boolean,
    "schemaId" integer NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE VIEW public.form_field_repeatmembership AS
 WITH repeatmembership AS (
         SELECT ff1."schemaId",
            ff1.path AS fieldpath,
            ff2.path AS repeatpath
           FROM (public.form_fields ff1
             LEFT JOIN public.form_fields ff2 ON (((ff1."schemaId" = ff2."schemaId") AND starts_with(ff1.path, (ff2.path || '/'::text)) AND ((ff2.type)::text = 'repeat'::text))))
        )
 SELECT repeatmembership."schemaId",
    repeatmembership.fieldpath AS path,
    array_remove(array_agg(repeatmembership.repeatpath ORDER BY (length(repeatmembership.repeatpath))), NULL::text) AS repeatgroups
   FROM repeatmembership
  GROUP BY repeatmembership."schemaId", repeatmembership.fieldpath;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON VIEW public.form_field_repeatmembership IS '{"dbsamizdat": {"version": 1, "definition_hash": "ec5eddaa15a263de704fd258891c4c1b"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE VIEW public.form_field_meta AS
 SELECT ff."formId" AS form_id,
    ff."schemaId" AS formschema_id,
    public.hash_text_to_bigint(VARIADIC ARRAY[(ff.type)::text, ff.path, ((cardinality(ffr.repeatgroups) > 0))::text]) AS fieldhash,
    ff."order" AS occurrence_order,
    cardinality(ffr.repeatgroups) AS repeatgroup_cardinality,
    ff.type,
    ff.path
   FROM (public.form_fields ff
     JOIN public.form_field_repeatmembership ffr ON (((ff."schemaId" = ffr."schemaId") AND (ff.path = ffr.path))));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON VIEW public.form_field_meta IS '{"dbsamizdat": {"version": 1, "definition_hash": "cd0367f94f1a74b8e537a90a1cd10383"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE VIEW public.form_field_geo AS
 WITH first_non_repeat_geo_annotated AS (
         SELECT ((rank() OVER (PARTITION BY form_field_meta.formschema_id, (form_field_meta.repeatgroup_cardinality = 0) ORDER BY form_field_meta.occurrence_order) = 1) AND (form_field_meta.repeatgroup_cardinality = 0)) AS is_first_non_repeat_geofeature,
            form_field_meta.form_id,
            form_field_meta.formschema_id,
            form_field_meta.fieldhash,
            form_field_meta.occurrence_order,
            form_field_meta.repeatgroup_cardinality,
            form_field_meta.type,
            form_field_meta.path
           FROM public.form_field_meta
          WHERE ((form_field_meta.type)::text = ANY ((ARRAY['geopoint'::character varying, 'geotrace'::character varying, 'geoshape'::character varying])::text[]))
        )
 SELECT first_non_repeat_geo_annotated.formschema_id,
    first_non_repeat_geo_annotated.is_first_non_repeat_geofeature AS is_default,
    first_non_repeat_geo_annotated.fieldhash,
    first_non_repeat_geo_annotated.repeatgroup_cardinality,
    first_non_repeat_geo_annotated.type,
    first_non_repeat_geo_annotated.path
   FROM first_non_repeat_geo_annotated;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON VIEW public.form_field_geo IS '{"dbsamizdat": {"version": 1, "definition_hash": "d41db151c588548301cc0edd0952b433"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.form_field_values (
    "formId" integer NOT NULL,
    "submissionDefId" integer NOT NULL,
    path text NOT NULL,
    value text
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.form_schemas (
    id integer NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.form_schemas_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.form_schemas_id_seq OWNED BY public.form_schemas.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.forms (
    id integer NOT NULL,
    "xmlFormId" character varying(64) NOT NULL,
    "createdAt" timestamp(3) with time zone,
    "updatedAt" timestamp(3) with time zone,
    "deletedAt" timestamp(3) with time zone,
    "acteeId" character varying(36) NOT NULL,
    state text DEFAULT 'open'::text,
    "projectId" integer NOT NULL,
    "currentDefId" integer,
    "draftDefId" integer,
    "enketoId" character varying(255),
    "enketoOnceId" text,
    "webformsEnabled" boolean DEFAULT false NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.forms_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.forms_id_seq OWNED BY public.forms.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.keys (
    id integer NOT NULL,
    public text NOT NULL,
    private jsonb,
    managed boolean,
    hint text,
    "createdAt" timestamp(3) with time zone
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.keys_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.keys_id_seq OWNED BY public.keys.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.knex_migrations (
    id integer NOT NULL,
    name character varying(255),
    batch integer,
    migration_time timestamp(3) with time zone
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.knex_migrations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.knex_migrations_id_seq OWNED BY public.knex_migrations.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.knex_migrations_lock (
    index integer NOT NULL,
    is_locked integer
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.knex_migrations_lock_index_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.knex_migrations_lock_index_seq OWNED BY public.knex_migrations_lock.index;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.projects (
    id integer NOT NULL,
    name text NOT NULL,
    "acteeId" character varying(36) NOT NULL,
    "createdAt" timestamp(3) with time zone,
    "updatedAt" timestamp(3) with time zone,
    "deletedAt" timestamp(3) with time zone,
    archived boolean,
    "keyId" integer,
    description text
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.projects_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.projects_id_seq OWNED BY public.projects.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.public_links (
    "actorId" integer NOT NULL,
    "createdBy" integer NOT NULL,
    "formId" integer NOT NULL,
    once boolean
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.purged_entities (
    "entityUuid" uuid NOT NULL,
    "acteeId" character varying NOT NULL,
    "auditId" integer NOT NULL
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public."purged_entities_auditId_seq"
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public."purged_entities_auditId_seq" OWNED BY public.purged_entities."auditId";
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.roles (
    id integer NOT NULL,
    name text NOT NULL,
    system character varying(8),
    "createdAt" timestamp(3) with time zone,
    "updatedAt" timestamp(3) with time zone,
    verbs jsonb
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.roles_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.roles_id_seq OWNED BY public.roles.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.sessions (
    "actorId" integer NOT NULL,
    token character varying(64) NOT NULL,
    "expiresAt" timestamp(3) with time zone NOT NULL,
    "createdAt" timestamp(3) with time zone,
    csrf character varying(64)
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.submission_attachments (
    "blobId" integer,
    name text NOT NULL,
    "submissionDefId" integer NOT NULL,
    index integer,
    "isClientAudit" boolean
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.submission_defs (
    id integer NOT NULL,
    "submissionId" integer NOT NULL,
    xml text NOT NULL,
    "formDefId" integer NOT NULL,
    "submitterId" integer,
    "createdAt" timestamp(3) with time zone,
    "encDataAttachmentName" character varying(255),
    "localKey" text,
    signature text,
    current boolean,
    "instanceName" text,
    "instanceId" character varying(64) NOT NULL,
    "userAgent" character varying(255),
    "deviceId" character varying(255),
    root boolean
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.submission_defs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.submission_defs_id_seq OWNED BY public.submission_defs.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.submission_field_extract_geo_cache (
    submission_def_id integer NOT NULL,
    fieldhash bigint NOT NULL,
    geovalue json
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.submissions (
    id integer NOT NULL,
    "formId" integer NOT NULL,
    "instanceId" character varying(64) NOT NULL,
    "createdAt" timestamp(3) with time zone,
    "updatedAt" timestamp(3) with time zone,
    "deletedAt" timestamp(3) with time zone,
    "submitterId" integer,
    "deviceId" character varying(255),
    draft boolean NOT NULL,
    "reviewState" text,
    event bigint
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE SEQUENCE public.submissions_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER SEQUENCE public.submissions_id_seq OWNED BY public.submissions.id;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.user_project_preferences (
    "userId" integer NOT NULL,
    "projectId" integer NOT NULL,
    "propertyName" text NOT NULL,
    "propertyValue" jsonb NOT NULL,
    CONSTRAINT "user_project_preferences_propertyName_check" CHECK ((length("propertyName") > 0))
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.user_site_preferences (
    "userId" integer NOT NULL,
    "propertyName" text NOT NULL,
    "propertyValue" jsonb NOT NULL,
    CONSTRAINT "user_site_preferences_propertyName_check" CHECK ((length("propertyName") > 0))
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TABLE public.users (
    "actorId" integer NOT NULL,
    password character varying(64),
    email public.citext NOT NULL,
    "lastLoginAt" timestamp(3) with time zone
);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.actors ALTER COLUMN id SET DEFAULT nextval('public.actors_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.audits ALTER COLUMN id SET DEFAULT nextval('public.audits_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.blobs ALTER COLUMN id SET DEFAULT nextval('public.blobs_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.comments ALTER COLUMN id SET DEFAULT nextval('public.comments_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.datasets ALTER COLUMN id SET DEFAULT nextval('public.datasets_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.ds_properties ALTER COLUMN id SET DEFAULT nextval('public.ds_properties_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entities ALTER COLUMN id SET DEFAULT nextval('public.entities_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_def_sources ALTER COLUMN id SET DEFAULT nextval('public.entity_def_sources_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_defs ALTER COLUMN id SET DEFAULT nextval('public.entity_defs_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_defs ALTER COLUMN id SET DEFAULT nextval('public.form_defs_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_schemas ALTER COLUMN id SET DEFAULT nextval('public.form_schemas_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.forms ALTER COLUMN id SET DEFAULT nextval('public.forms_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.keys ALTER COLUMN id SET DEFAULT nextval('public.keys_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.knex_migrations ALTER COLUMN id SET DEFAULT nextval('public.knex_migrations_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.knex_migrations_lock ALTER COLUMN index SET DEFAULT nextval('public.knex_migrations_lock_index_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.projects ALTER COLUMN id SET DEFAULT nextval('public.projects_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.purged_entities ALTER COLUMN "auditId" SET DEFAULT nextval('public."purged_entities_auditId_seq"'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.roles ALTER COLUMN id SET DEFAULT nextval('public.roles_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_defs ALTER COLUMN id SET DEFAULT nextval('public.submission_defs_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submissions ALTER COLUMN id SET DEFAULT nextval('public.submissions_id_seq'::regclass);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.actees (id, species, parent, "purgedAt", "purgedName", details) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "471536"
LINE 1: 471536b3-b9c8-4570-b1b9-51a716225db7 system 
        ^
STATEMENT:  471536b3-b9c8-4570-b1b9-51a716225db7    system    
275df6dd-b331-41bf-9152-5ad2293c7c6d    system    
c4df7542-e3f3-447a-8547-2719fec6a361    system    
aa395b1a-186e-4a10-ba51-e1cf2e39e121    system    
*    *    
actor    *    
group    *    
user    *    
form    *    
submission    *    
field_key    *    
config    *    
project    *    
role    *    
assignment    *    
audit    *    
4cf8337a-3068-44cc-8b19-e058179b6bcf    user    
18a9804e-7b64-40bb-b819-036ae0e9a5f3    project    
6e8c7741-6e03-42af-b966-f549b180bba5    form    18a9804e-7b64-40bb-b819-036ae0e9a5f3    
7f654526-1c1e-442b-9b56-42fe24dae123    singleUse    



COPY public.actors (id, type, "acteeId", "displayName", meta, "createdAt", "updatedAt", "deletedAt", "expiresAt") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "5"
LINE 1: 5 user 4cf8337a-3068-44cc-8b19-e058179b6bcf sadiqkhoja@gmail...
        ^
STATEMENT:  5    user    4cf8337a-3068-44cc-8b19-e058179b6bcf    sadiqkhoja@gmail.com    
6    singleUse    7f654526-1c1e-442b-9b56-42fe24dae123    Enketo sync token for 6e8c7741-6e03-42af-b966-f549b180bba5    



COPY public.assignments ("actorId", "roleId", "acteeId") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "5"
LINE 1: 5 1 *
        ^
STATEMENT:  5    1    *
6    7    6e8c7741-6e03-42af-b966-f549b180bba5



COPY public.audits ("actorId", action, "acteeId", details, "loggedAt", claimed, processed, "lastFailure", failures, id, notes) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "5"
LINE 1: 5 user.session.create 4cf8337a-3068-44cc-8b19-e058179b6bcf {...
        ^
STATEMENT:  5    user.session.create    4cf8337a-3068-44cc-8b19-e058179b6bcf    {"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:149.0) Gecko/20100101 Firefox/149.0"}    2026-04-13 18:36:59.24+00    
5    project.create    18a9804e-7b64-40bb-b819-036ae0e9a5f3    {"data": {"name": "Defaul"}}    2026-04-13 18:37:07.709+00    
5    user.preference.update    4cf8337a-3068-44cc-8b19-e058179b6bcf    {"scope": "site", "propertyName": "whatsNewDismissed", "propertyValue": "2026.1"}    2026-04-13 18:37:01.065+00    2026-04-13 18:37:24.311+00    2026-04-13 18:37:24.332+00    
5    form.create    6e8c7741-6e03-42af-b966-f549b180bba5    
5    form.update.publish    6e8c7741-6e03-42af-b966-f549b180bba5    {"newDefId": 1, "oldDefId": null}    2026-04-13 18:37:20.83+00    2026-04-13 18:37:24.352+00    2026-04-13 18:37:24.355+00    
5    user.preference.update    4cf8337a-3068-44cc-8b19-e058179b6bcf    {"scope": "site", "propertyName": "mailingListOptIn", "propertyValue": true}    2026-04-13 18:37:01.065+00    2026-04-13 18:37:24.311+00    2026-04-13 18:37:24.541+00    
5    submission.create    6e8c7741-6e03-42af-b966-f549b180bba5    {"instanceId": "uuid:3ad32f4a-ef55-4be3-8cd1-e5f0c6f97636", "submissionId": 1, "submissionDefId": 1}    2026-04-13 18:37:27.173+00    2026-04-13 18:37:30.36+00    2026-04-13 18:37:30.383+00    



COPY public.blobs (id, sha, content, "contentType", md5, s3_status) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "2"
LINE 1: 2 e8cc6cd1c81a366803b00921a55c50c1409c6e95 
        ^
STATEMENT:  2    e8cc6cd1c81a366803b00921a55c50c1409c6e95    



COPY public.client_audits ("blobId", event, node, start, "end", latitude, longitude, accuracy, "old-value", "new-value", remainder, "user", "change-reason") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.comments (id, "submissionId", "actorId", body, "createdAt") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.config (key, value, "setAt", "blobId") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.current_event (event) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1
        ^
STATEMENT:  1



COPY public.dataset_form_defs ("datasetId", "formDefId", actions, path, "isRepeat") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.datasets (id, name, "acteeId", "createdAt", "projectId", "publishedAt", "approvalRequired", "ownerOnly", "deletedAt") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.ds_properties (id, name, "datasetId", "publishedAt", "deletedAt") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.ds_property_fields ("dsPropertyId", "formDefId", path) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.entities (id, uuid, "datasetId", "createdAt", "creatorId", "updatedAt", "deletedAt", conflict) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.entity_def_sources (id, type, "auditId", "submissionDefId", details, "forceProcessed") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.entity_defs (id, "entityId", "createdAt", current, data, "creatorId", "userAgent", label, root, "sourceId", version, "dataReceived", "baseVersion", "conflictingProperties", "branchId", "trunkVersion", "branchBaseVersion") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.entity_submission_backlog ("submissionId", "submissionDefId", "branchId", "branchBaseVersion", "loggedAt", "auditId", "entityUuid") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.field_keys ("actorId", "createdBy", "projectId") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.form_attachments ("formId", "blobId", name, type, "formDefId", "updatedAt", "datasetId") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.form_defs (id, "formId", xml, hash, sha, sha256, version, "createdAt", "keyId", "xlsBlobId", "publishedAt", "draftToken", "enketoId", name, "schemaId") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1 1 <?xml version="1.0"?><h:html xmlns="http://www.w3.org/20...
        ^
STATEMENT:  1    1    <?xml version="1.0"?><h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" xmlns:odk="http://www.opendatakit.org/xforms"><h:head><h:title>Display Picture</h:title><model odk:xforms-version="1.0.0"><instance><data id="display_picture" version="20260409145337"><dp3/><dp2/><t1/><t2/><t3/><t4/><t5/><t6/><t7/><t8/><t9/><t10/><t11/><t12/><t13/><t14/><t15/><t16/><t17/><t18/><t19/><t20/><t21/><t22/><t23/><t24/><t25/><t26/><t27/><t28/><t29/><t30/><t31/><t32/><t33/><t34/><t35/><t36/><t37/><t38/><t39/><t40/><t41/><t42/><t43/><t44/><meta><instanceID/></meta></data></instance><bind nodeset="/data/dp3" type="binary"/><bind nodeset="/data/dp2" type="binary"/><bind nodeset="/data/t1" type="string"/><bind nodeset="/data/t2" type="string"/><bind nodeset="/data/t3" type="string"/><bind nodeset="/data/t4" type="string"/><bind nodeset="/data/t5" type="string"/><bind nodeset="/data/t6" type="string"/><bind nodeset="/data/t7" type="string"/><bind nodeset="/data/t8" type="string"/><bind nodeset="/data/t9" type="string"/><bind nodeset="/data/t10" type="string"/><bind nodeset="/data/t11" type="string"/><bind nodeset="/data/t12" type="string"/><bind nodeset="/data/t13" type="string"/><bind nodeset="/data/t14" type="string"/><bind nodeset="/data/t15" type="string"/><bind nodeset="/data/t16" type="string"/><bind nodeset="/data/t17" type="string"/><bind nodeset="/data/t18" type="string"/><bind nodeset="/data/t19" type="string"/><bind nodeset="/data/t20" type="string"/><bind nodeset="/data/t21" type="string"/><bind nodeset="/data/t22" type="string"/><bind nodeset="/data/t23" type="string"/><bind nodeset="/data/t24" type="string"/><bind nodeset="/data/t25" type="string"/><bind nodeset="/data/t26" type="string"/><bind nodeset="/data/t27" type="string"/><bind nodeset="/data/t28" type="string"/><bind nodeset="/data/t29" type="string"/><bind nodeset="/data/t30" type="string"/><bind nodeset="/data/t31" type="string"/><bind nodeset="/data/t32" type="string"/><bind nodeset="/data/t33" type="string"/><bind nodeset="/data/t34" type="string"/><bind nodeset="/data/t35" type="string"/><bind nodeset="/data/t36" type="string"/><bind nodeset="/data/t37" type="string"/><bind nodeset="/data/t38" type="string"/><bind nodeset="/data/t39" type="string"/><bind nodeset="/data/t40" type="string"/><bind nodeset="/data/t41" type="string"/><bind nodeset="/data/t42" type="string"/><bind nodeset="/data/t43" type="string"/><bind nodeset="/data/t44" type="string"/><bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid"/></model></h:head><h:body><upload ref="/data/dp3" mediatype="image/*"><label>Display Picture</label></upload><upload ref="/data/dp2" mediatype="image/*"><label>Display Picture 2</label></upload><input ref="/data/t1"><label>t1</label></input><input ref="/data/t2"><label>t2</label></input><input ref="/data/t3"><label>t3</label></input><input ref="/data/t4"><label>t4</label></input><input ref="/data/t5"><label>t5</label></input><input ref="/data/t6"><label>t6</label></input><input ref="/data/t7"><label>t7</label></input><input ref="/data/t8"><label>t8</label></input><input ref="/data/t9"><label>t9</label></input><input ref="/data/t10"><label>t10</label></input><input ref="/data/t11"><label>t11</label></input><input ref="/data/t12"><label>t12</label></input><input ref="/data/t13"><label>t13</label></input><input ref="/data/t14"><label>t14</label></input><input ref="/data/t15"><label>t15</label></input><input ref="/data/t16"><label>t16</label></input><input ref="/data/t17"><label>t17</label></input><input ref="/data/t18"><label>t18</label></input><input ref="/data/t19"><label>t19</label></input><input ref="/data/t20"><label>t20</label></input><input ref="/data/t21"><label>t21</label></input><input ref="/data/t22"><label>t22</label></input><input ref="/data/t23"><label>t23</label></input><input ref="/data/t24"><label>t24</label></input><input ref="/data/t25"><label>t25</label></input><input ref="/data/t26"><label>t26</label></input><input ref="/data/t27"><label>t27</label></input><input ref="/data/t28"><label>t28</label></input><input ref="/data/t29"><label>t29</label></input><input ref="/data/t30"><label>t30</label></input><input ref="/data/t31"><label>t31</label></input><input ref="/data/t32"><label>t32</label></input><input ref="/data/t33"><label>t33</label></input><input ref="/data/t34"><label>t34</label></input><input ref="/data/t35"><label>t35</label></input><input ref="/data/t36"><label>t36</label></input><input ref="/data/t37"><label>t37</label></input><input ref="/data/t38"><label>t38</label></input><input ref="/data/t39"><label>t39</label></input><input ref="/data/t40"><label>t40</label></input><input ref="/data/t41"><label>t41</label></input><input ref="/data/t42"><label>t42</label></input><input ref="/data/t43"><label>t43</label></input><input ref="/data/t44"><label>t44</label></input></h:body></h:html>    d9f42481f24402ddfdbcd831ad11d5dd    530065fa95504d778308e7340fedfc549784d16d    e1e670c20b31ee34deacff178985957d0c4b9018eabfb4ff600be43beb07ab65    20260409145337    2026-04-13 18:37:17.373+00    



COPY public.form_field_values ("formId", "submissionDefId", path, value) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.form_fields ("formId", path, name, type, "binary", "order", "selectMultiple", "schemaId") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1 /dp3 dp3 binary t 0 
        ^
STATEMENT:  1    /dp3    dp3    binary    t    0    
1    /dp2    dp2    binary    t    1    
1    /t1    t1    string    
1    /t2    t2    string    
1    /t3    t3    string    
1    /t4    t4    string    
1    /t5    t5    string    
1    /t6    t6    string    
1    /t7    t7    string    
1    /t8    t8    string    
1    /t9    t9    string    
1    /t10    t10    string    
1    /t11    t11    string    
1    /t12    t12    string    
1    /t13    t13    string    
1    /t14    t14    string    
1    /t15    t15    string    
1    /t16    t16    string    
1    /t17    t17    string    
1    /t18    t18    string    
1    /t19    t19    string    
1    /t20    t20    string    
1    /t21    t21    string    
1    /t22    t22    string    
1    /t23    t23    string    
1    /t24    t24    string    
1    /t25    t25    string    
1    /t26    t26    string    
1    /t27    t27    string    
1    /t28    t28    string    
1    /t29    t29    string    
1    /t30    t30    string    
1    /t31    t31    string    
1    /t32    t32    string    
1    /t33    t33    string    
1    /t34    t34    string    
1    /t35    t35    string    
1    /t36    t36    string    
1    /t37    t37    string    
1    /t38    t38    string    
1    /t39    t39    string    
1    /t40    t40    string    
1    /t41    t41    string    
1    /t42    t42    string    
1    /t43    t43    string    
1    /t44    t44    string    
1    /meta    meta    structure    
1    /meta/instanceID    instanceID    string    



COPY public.form_schemas (id) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1
        ^
STATEMENT:  1



COPY public.forms (id, "xmlFormId", "createdAt", "updatedAt", "deletedAt", "acteeId", state, "projectId", "currentDefId", "draftDefId", "enketoId", "enketoOnceId", "webformsEnabled") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1 display_picture 2026-04-13 18:37:17.373+00 2026-04-13 18:3...
        ^
STATEMENT:  1    display_picture    2026-04-13 18:37:17.373+00    2026-04-13 18:37:20.812+00    



COPY public.keys (id, public, private, managed, hint, "createdAt") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.knex_migrations (id, name, batch, migration_time) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1 20170920-01-initial.js 1 2026-04-13 18:34:35.218+00
        ^
STATEMENT:  1    20170920-01-initial.js    1    2026-04-13 18:34:35.218+00
2    20171010-01-auth.js    1    2026-04-13 18:34:35.271+00
3    20171023-01-authz-forms.js    1    2026-04-13 18:34:35.273+00
4    20171030-01-add-default-authz-records.js    1    2026-04-13 18:34:35.281+00
5    20171106-01-remove-user-update-timestamp.js    1    2026-04-13 18:34:35.283+00
6    20171121-01-add-submissions-constraint.js    1    2026-04-13 18:34:35.285+00
7    20171121-02-add-submitter.js    1    2026-04-13 18:34:35.287+00
8    20171213-01-unrequire-display-name.js    1    2026-04-13 18:34:35.289+00
9    20180108-01-expiring-actors.js    1    2026-04-13 18:34:35.29+00
10    20180108-02-enum-to-varchar.js    1    2026-04-13 18:34:35.299+00
11    20180112-01-audit-table.js    1    2026-04-13 18:34:35.311+00
12    20180112-02-add-field-keys.js    1    2026-04-13 18:34:35.316+00
13    20180118-01-rerequire-display-name.js    1    2026-04-13 18:34:35.318+00
14    20180125-01-add-form-detail-fields.js    1    2026-04-13 18:34:35.318+00
15    20180125-02-more-field-key-grants.js    1    2026-04-13 18:34:35.32+00
16    20180125-03-add-blob-tables.js    1    2026-04-13 18:34:35.334+00
17    20180301-01-configuration.js    1    2026-04-13 18:34:35.338+00
18    20180322-01-additional-form-options.js    1    2026-04-13 18:34:35.341+00
19    20180327-01-update-form-constraints.js    1    2026-04-13 18:34:35.344+00
20    20180501-01-add-configs-timestamp.js    1    2026-04-13 18:34:35.345+00
21    20180501-02-fix-date-columns.js    1    2026-04-13 18:34:35.354+00
22    20180515-01-enforce-nonnull-form-version.js    1    2026-04-13 18:34:35.355+00
23    20180727-01-rename-attachments-table.js    1    2026-04-13 18:34:35.355+00
24    20180727-02-add-md5-to-blobs.js    1    2026-04-13 18:34:35.356+00
25    20180727-03-add-form-attachments-table.js    1    2026-04-13 18:34:35.362+00
26    20181011-make-email-case-insensitive.js    1    2026-04-13 18:34:35.367+00
27    20181012-01-add-submissions-createdat-index.js    1    2026-04-13 18:34:35.368+00
28    20181206-01-add-projects.js    1    2026-04-13 18:34:35.379+00
29    20181207-01-grant-verbs-to-text.js    1    2026-04-13 18:34:35.383+00
30    20181207-02-rename-grant-verbs.js    1    2026-04-13 18:34:35.385+00
31    20181211-01-audit-verbs-to-text.js    1    2026-04-13 18:34:35.386+00
32    20181211-02-rename-audit-actions.js    1    2026-04-13 18:34:35.387+00
33    20181212-00-fix-user-type.js    1    2026-04-13 18:34:35.388+00
34    20181212-01-add-roles.js    1    2026-04-13 18:34:35.402+00
35    20181212-02-remove-groups.js    1    2026-04-13 18:34:35.404+00
36    20181212-03-add-single-use-roles.js    1    2026-04-13 18:34:35.405+00
37    20181219-01-add-submission-update-verb.js    1    2026-04-13 18:34:35.406+00
38    20181221-01-nullable-submission-blobs.js    1    2026-04-13 18:34:35.406+00
39    20181230-01-add-device-id-to-submission.js    1    2026-04-13 18:34:35.407+00
40    20190225-01-add-actor-trigram-indices.js    1    2026-04-13 18:34:35.408+00
41    20190225-02-add-role-grants.js    1    2026-04-13 18:34:35.409+00
42    20190226-01-convert-verbs-to-jsonb.js    1    2026-04-13 18:34:35.411+00
43    20190226-02-add-role-actee-species.js    1    2026-04-13 18:34:35.411+00
44    20190226-03-add-assignment-verbs.js    1    2026-04-13 18:34:35.412+00
45    20190226-04-add-assignment-actee-species.js    1    2026-04-13 18:34:35.412+00
46    20190227-01-add-project-manager-role.js    1    2026-04-13 18:34:35.412+00
47    20190405-01-add-project-archival-flag.js    1    2026-04-13 18:34:35.413+00
48    20190416-01-email-uniqueness.js    1    2026-04-13 18:34:35.414+00
49    20190416-02-add-user-delete-verb.js    1    2026-04-13 18:34:35.415+00
50    20190520-01-add-form-versioning.js    1    2026-04-13 18:34:35.447+00
51    20190523-01-add-form-state-constraint.js    1    2026-04-13 18:34:35.447+00
52    20190605-01-reformat-audits.js    1    2026-04-13 18:34:35.448+00
53    20190607-01-convert-audit-details-to-jsonb.js    1    2026-04-13 18:34:35.455+00
54    20190607-02-standardize-attachment-actees.js    1    2026-04-13 18:34:35.456+00
55    20190607-03-rename-sub-attachment-audits.js    1    2026-04-13 18:34:35.456+00
56    20190610-01-add-audits-verbs.js    1    2026-04-13 18:34:35.457+00
57    20190610-02-backfill-submission-audit-instanceids.js    1    2026-04-13 18:34:35.457+00
58    20190611-01-add-updatedat-to-form-attachments.js    1    2026-04-13 18:34:35.458+00
59    20190618-01-add-csrf-token.js    1    2026-04-13 18:34:35.458+00
60    20190618-01-add-encryption-tracking.js    1    2026-04-13 18:34:35.464+00
61    20190701-01-add-managed-encryption-key-check.js    1    2026-04-13 18:34:35.464+00
62    20190916-01-granularize-app-user-permissions.js    1    2026-04-13 18:34:35.469+00
63    20190917-01-cleanup-app-user-role.js    1    2026-04-13 18:34:35.47+00
64    20190923-01-add-project-viewer-role.js    1    2026-04-13 18:34:35.47+00
65    20190925-01-add-client-audits.js    1    2026-04-13 18:34:35.473+00
66    20191007-01-backfill-client-audits.js    1    2026-04-13 18:34:35.475+00
67    20191010-01-add-excel-blob-reference.js    1    2026-04-13 18:34:35.475+00
68    20191023-01-add-worker-columns-to-audits.js    1    2026-04-13 18:34:35.477+00
69    20191025-01-add-id-to-audits.js    1    2026-04-13 18:34:35.489+00
70    20191106-01-remove-deleted-actor-assignments.js    1    2026-04-13 18:34:35.49+00
71    20191231-01-remove-transformations.js    1    2026-04-13 18:34:35.491+00
72    20191231-02-add-schema-storage.js    1    2026-04-13 18:34:35.497+00
73    20200110-01-add-drafts.js    1    2026-04-13 18:34:35.5+00
74    20200112-01-check-field-collisions.js    1    2026-04-13 18:34:35.5+00
75    20200114-01-remove-formid-sha256-constraint.js    1    2026-04-13 18:34:35.501+00
76    20200117-01-draft-test-submissions.js    1    2026-04-13 18:34:35.503+00
77    20200121-01-add-draft-keys.js    1    2026-04-13 18:34:35.503+00
78    20200122-01-remove-draft-form-state.js    1    2026-04-13 18:34:35.503+00
79    20200129-01-cascade-submission-deletes.js    1    2026-04-13 18:34:35.504+00
80    20200220-01-repair-submission-parsing.js    1    2026-04-13 18:34:35.505+00
81    20200403-01-add-performance-indices.js    1    2026-04-13 18:34:35.507+00
82    20200407-01-allow-actorless-submission-defs.js    1    2026-04-13 18:34:35.508+00
83    20200423-01-fix-field-insert-performance.js    1    2026-04-13 18:34:35.508+00
84    20200428-01-allow-string-downcast.js    1    2026-04-13 18:34:35.509+00
85    20200519-01-add-enketo-id.js    1    2026-04-13 18:34:35.509+00
86    20200519-02-add-form-viewer-role.js    1    2026-04-13 18:34:35.509+00
87    20200520-01-backfill-enketo.js    1    2026-04-13 18:34:35.51+00
88    20200715-01-add-data-collector-role.js    1    2026-04-13 18:34:35.51+00
89    20200721-01-add-public-links.js    1    2026-04-13 18:34:35.514+00
90    20200728-01-add-enketo-single-token-to-forms.js    1    2026-04-13 18:34:35.514+00
91    20200731-01-allow-project-managers-to-end-sessions.js    1    2026-04-13 18:34:35.514+00
92    20200810-01-reschedule-enketo-processing.js    1    2026-04-13 18:34:35.515+00
93    20200918-01-repair-publishedat-dates.js    1    2026-04-13 18:34:35.515+00
94    20200930-01-add-backup-run-verb.js    1    2026-04-13 18:34:35.516+00
95    20201117-01-remove-deleted-actor-assignments-again.js    1    2026-04-13 18:34:35.516+00
96    20201207-01-harmonize-submitter-id-columns.js    1    2026-04-13 18:34:35.516+00
97    20210118-01-add-current-flag-to-submission-defs.js    1    2026-04-13 18:34:35.519+00
98    20210120-01-instance-names.js    1    2026-04-13 18:34:35.52+00
99    20210203-01-add-hierarchy-to-actees.js    1    2026-04-13 18:34:35.522+00
100    20210210-01-add-instanceid-to-submission-defs.js    1    2026-04-13 18:34:35.524+00
101    20210218-01-add-submission-edit-verbs.js    1    2026-04-13 18:34:35.525+00
102    20210218-02-add-draft-to-submissions-unique.js    1    2026-04-13 18:34:35.528+00
103    20210219-01-add-review-state.js    1    2026-04-13 18:34:35.529+00
104    20210219-02-add-notes-and-index-to-audits.js    1    2026-04-13 18:34:35.529+00
105    20210324-01-add-submission-edit-verbs-to-managers.js    1    2026-04-13 18:34:35.53+00
106    20210325-01-remove-project.list-verb.js    1    2026-04-13 18:34:35.531+00
107    20210408-01-drop-public-link-createdat.js    1    2026-04-13 18:34:35.531+00
108    20210408-02-backfill-specialized-actor-audits.js    1    2026-04-13 18:34:35.532+00
109    20210409-01-add-comments.js    1    2026-04-13 18:34:35.537+00
110    20210409-02-update-review-states.js    1    2026-04-13 18:34:35.537+00
111    20210423-01-add-name-to-form-def.js    1    2026-04-13 18:34:35.538+00
112    20210423-02-drop-form-name.js    1    2026-04-13 18:34:35.538+00
113    20210716-01-config-value-jsonb.js    1    2026-04-13 18:34:35.541+00
114    20210721-01-add-config-set-verb.js    1    2026-04-13 18:34:35.542+00
115    20210817-01-disallow-structure-downcast-to-string.js    1    2026-04-13 18:34:35.542+00
116    20210825-01-add-analytics-read-verb.js    1    2026-04-13 18:34:35.543+00
117    20210903-01-backfill-encrypted-client-audits.js    1    2026-04-13 18:34:35.543+00
118    20210927-01-revert-disallow-structure-downcast.js    1    2026-04-13 18:34:35.544+00
119    20211008-01-track-select-many-options.js    1    2026-04-13 18:34:35.552+00
120    20211021-remove-hashes-from-audits.js    1    2026-04-13 18:34:35.553+00
121    20211109-01-add-user-agent-to-submissions.js    1    2026-04-13 18:34:35.554+00
122    20211114-01-flag-initial-submission-def.js    1    2026-04-13 18:34:35.554+00
123    20211117-01-add-form-restore-verb.js    1    2026-04-13 18:34:35.555+00
124    20211129-01-add-purged-details-to-actees.js    1    2026-04-13 18:34:35.557+00
125    20220121-01-form-cascade-delete.js    1    2026-04-13 18:34:35.563+00
126    20220121-02-purge-deleted-forms.js    1    2026-04-13 18:34:35.564+00
127    20220209-01-purge-unneeded-drafts.js    1    2026-04-13 18:34:35.565+00
128    20220309-01-add-project-description.js    1    2026-04-13 18:34:35.565+00
129    20220803-01-create-entities-schema.js    1    2026-04-13 18:34:35.587+00
130    20221003-01-add-dataset-verbs.js    1    2026-04-13 18:34:35.588+00
131    20221114-01-explict-dataset-publish.js    1    2026-04-13 18:34:35.589+00
132    20221117-01-check-datasetId-is-null-for-non-file-type.js    1    2026-04-13 18:34:35.59+00
133    20221118-01-make-entities-columns-not-null.js    1    2026-04-13 18:34:35.594+00
134    20221208-01-reduce-tz-precision.js    1    2026-04-13 18:34:35.68+00
135    20230106-01-remove-revision-number.js    1    2026-04-13 18:34:35.681+00
136    20230109-01-add-form-schema.js    1    2026-04-13 18:34:35.691+00
137    20230123-01-remove-google-backups.js    1    2026-04-13 18:34:35.693+00
138    20230126-01-add-entity-indices.js    1    2026-04-13 18:34:35.696+00
139    20230127-01-rename-entity-created-by.js    1    2026-04-13 18:34:35.697+00
140    20230324-01-edit-dataset-verbs.js    1    2026-04-13 18:34:35.698+00
141    20230406-01-add-entity-def-fields.js    1    2026-04-13 18:34:35.699+00
142    20230406-02-move-entity-label-add-deletedAt.js    1    2026-04-13 18:34:35.699+00
143    20230414-01-remove-user-mfa-secret.js    1    2026-04-13 18:34:35.7+00
144    20230419-01-optimize-indices-sub-defs.js    1    2026-04-13 18:34:35.703+00
145    20230509-01-dataset-approval-flag.js    1    2026-04-13 18:34:35.704+00
146    20230512-01-add-entity-root.js    1    2026-04-13 18:34:35.705+00
147    20230512-02-backfill-entity-id.js    1    2026-04-13 18:34:35.705+00
148    20230512-03-add-entity-source.js    1    2026-04-13 18:34:35.712+00
149    20230518-01-add-entity-index-to-audits.js    1    2026-04-13 18:34:35.712+00
150    20230802-01-delete-orphan-submissions.js    1    2026-04-13 18:34:35.713+00
151    20230818-01-remove-schemaId-from-dsPropertyFields.js    1    2026-04-13 18:34:35.713+00
152    20230824-01-add-entity-version.js    1    2026-04-13 18:34:35.714+00
153    20230830-01-remove-entity-label-from-audits.js    1    2026-04-13 18:34:35.714+00
154    20230907-01-opened-form-verb.js    1    2026-04-13 18:34:35.714+00
155    20231002-01-add-conflict-details.js    1    2026-04-13 18:34:35.715+00
156    20231013-01-change-entity-error-action.js    1    2026-04-13 18:34:35.716+00
157    20231208-01-dataset-form-def-actions.js    1    2026-04-13 18:34:35.717+00
158    20240215-01-entity-delete-verb.js    1    2026-04-13 18:34:35.719+00
159    20240215-02-dedupe-verbs.js    1    2026-04-13 18:34:35.719+00
160    20240312-01-add-dataset-create-verb.js    1    2026-04-13 18:34:35.719+00
161    20240322-01-add-entity-source-index-to-audits.js    1    2026-04-13 18:34:35.72+00
162    20240515-01-entity-tz-precision.js    1    2026-04-13 18:34:35.727+00
163    20240607-01-add-offline-entity-branch-trunk-info.js    1    2026-04-13 18:34:35.728+00
164    20240607-02-add-submission-backlog.js    1    2026-04-13 18:34:35.73+00
165    20240715-01-backlog-add-event-entityuuid.js    1    2026-04-13 18:34:35.73+00
166    20240913-01-add-blob-s3.js    1    2026-04-13 18:34:35.731+00
167    20240914-01-add-submission-delete-verb.js    1    2026-04-13 18:34:35.731+00
168    20240914-02-remove-orphaned-client-audits.js    1    2026-04-13 18:34:35.731+00
169    20241001-01-index-on-session-table.js    1    2026-04-13 18:34:35.732+00
170    20241008-01-add-user_preferences.js    1    2026-04-13 18:34:35.741+00
171    20241010-01-schedule-entity-form-upgrade.js    1    2026-04-13 18:34:35.742+00
172    20241029-01-schedule-entity-form-upgrade-create-forms.js    1    2026-04-13 18:34:35.742+00
173    20241030-01-add-force-entity-def-source.js    1    2026-04-13 18:34:35.742+00
174    20241224-01-entity-restore-verb.js    1    2026-04-13 18:34:35.743+00
175    20241224-02-cascade-entity-purge.js    1    2026-04-13 18:34:35.743+00
176    20241226-01-indices-for-purging-entities.js    1    2026-04-13 18:34:35.744+00
177    20241227-01-backfill-audit-entity-uuid.js    1    2026-04-13 18:34:35.744+00
178    20250113-01-add-webformsenabled-formtable-column.js    1    2026-04-13 18:34:35.745+00
179    20250113-01-disable-nullable-blob-content-types.js    1    2026-04-13 18:34:35.745+00
180    20250221-01-deletedAt-index-entity.js    1    2026-04-13 18:34:35.747+00
181    20250307-01-purged-entities-table.js    1    2026-04-13 18:34:35.755+00
182    20250415-01-client-audit-remainder.js    1    2026-04-13 18:34:35.755+00
183    20250428-01-audit-indices.js    1    2026-04-13 18:34:35.757+00
184    20250528-01-entity-search-index.js    1    2026-04-13 18:34:35.759+00
185    20250609-01-owner-only.js    1    2026-04-13 18:34:35.76+00
186    20250609-02-index-entity-creator.js    1    2026-04-13 18:34:35.761+00
187    20250611-01-owner-only-index.js    1    2026-04-13 18:34:35.762+00
188    20250806-01-blob-uniq-by-sha-and-content-type.js    1    2026-04-13 18:34:35.764+00
189    20250826-01-entities.datasetId-notnull.js    1    2026-04-13 18:34:35.764+00
190    20250827-01-all-fk-indexes.js    1    2026-04-13 18:34:35.804+00
191    20250827-02-audits-entityuuids-gin-index.js    1    2026-04-13 18:34:35.805+00
192    20250909-01-status-indices.js    1    2026-04-13 18:34:35.807+00
193    20250910-01-add-last-login-at-column.js    1    2026-04-13 18:34:35.807+00
194    20250910-02-backfill-last-login-at.js    1    2026-04-13 18:34:35.808+00
195    20250923-01-dataset-form-def-entity-scope.js    1    2026-04-13 18:34:35.808+00
196    20250923-02-rm-entity-def-sources-index.js    1    2026-04-13 18:34:35.81+00
197    20250927-01-geoextracts.js    1    2026-04-13 18:34:35.822+00
198    20250928-01-backfill-submission-geocache-createfunction.js    1    2026-04-13 18:34:35.823+00
199    20250928-01-backfill-submission-geocache-doit.js    1    2026-04-13 18:34:35.824+00
200    20251118-01-s3-add-skipped-status.js    1    2026-04-13 18:34:35.825+00
201    20251127-01-submission-event-stamping.js    1    2026-04-13 18:34:35.829+00
202    20251201-01-entities-uuid-column-uuid-datatype.js    1    2026-04-13 18:34:35.84+00
203    20251209-01-ignore-leading-zeroes-for-geojson-geocomponents.js    1    2026-04-13 18:34:35.845+00
204    20260113-01-add-deletedAt-dataset-properties.js    1    2026-04-13 18:34:35.846+00
205    20260115-01-submission-event-stamping-unshared-events.js    1    2026-04-13 18:34:35.85+00
206    20260116-01-hash-aggregate.js    1    2026-04-13 18:34:35.851+00
207    20260119-01-dataset-delete-verbs-and-indices.js    1    2026-04-13 18:34:35.852+00
208    20260202-01-ds-properties-partial-index-entity-defs-gin.js    1    2026-04-13 18:34:35.855+00
209    20260203-01-dataset-delete-cascade.js    1    2026-04-13 18:34:35.857+00
210    20260312-01-add-config-blobId.js    1    2026-04-13 18:34:35.858+00



COPY public.knex_migrations_lock (index, is_locked) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1 0
        ^
STATEMENT:  1    0



COPY public.projects (id, name, "acteeId", "createdAt", "updatedAt", "deletedAt", archived, "keyId", description) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1 Defaul 18a9804e-7b64-40bb-b819-036ae0e9a5f3 2026-04-13 18:...
        ^
STATEMENT:  1    Defaul    18a9804e-7b64-40bb-b819-036ae0e9a5f3    2026-04-13 18:37:07.707+00    



COPY public.public_links ("actorId", "createdBy", "formId", once) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.purged_entities ("entityUuid", "acteeId", "auditId") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.roles (id, name, system, "createdAt", "updatedAt", verbs) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "3"
LINE 1: 3 Password Reset Token pwreset 2026-04-13 18:34:35.405+00 
        ^
STATEMENT:  3    Password Reset Token    pwreset    2026-04-13 18:34:35.405+00    
6    Project Viewer    viewer    
2    App User    app-user    2026-04-13 18:34:35.391+00    
7    Form Viewer (system internal)    formview    
8    Data Collector    formfill    
9    Public Link    pub-link    2026-04-13 18:34:35.513+00    
5    Project Manager    manager    
1    Administrator    admin    2026-04-13 18:34:35.391+00    



COPY public.sessions ("actorId", token, "expiresAt", "createdAt", csrf) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "5"
LINE 1: 5 hGJvUXyESReKYal$lv8kHk$EUJq5dPgmfwrBVMd4seZsohPRcaLBcUvnY!...
        ^
STATEMENT:  5    hGJvUXyESReKYal$lv8kHk$EUJq5dPgmfwrBVMd4seZsohPRcaLBcUvnY!tD2IYA    2026-04-14 18:36:59.237+00    2026-04-13 18:36:59.237+00    QiDbvIpaKMGDIcpVPJsXIoX$ydklj7P5d825XJxfmtixe5yZbsVdZIbTSk4rAyvu
6    tu5HQUub5$WqJD4Vh1PGSCXIN8mB0Dw0whjV3GQHmz!8Toj3UmPjONKPJRvupGre    2026-04-13 18:52:20.78+00    2026-04-13 18:37:20.79+00    EuRVLhMkmu70lmpt6qKZxBuaQlKzMO7gmKytiS4kQzudSf0jsN4g5ewzwYVUpkkU



COPY public.submission_attachments ("blobId", name, "submissionDefId", index, "isClientAudit") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.submission_defs (id, "submissionId", xml, "formDefId", "submitterId", "createdAt", "encDataAttachmentName", "localKey", signature, current, "instanceName", "instanceId", "userAgent", "deviceId", root) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1 1 <data xmlns:jr="http://openrosa.org/javarosa" xmlns:orx=...
        ^
STATEMENT:  1    1    <data xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" id="display_picture" version="20260409145337"><dp3/><dp2/><t1/><t2/><t3/><t4/><t5/><t6/><t7/><t8/><t9/><t10/><t11/><t12/><t13/><t14/><t15/><t16/><t17/><t18/><t19/><t20/><t21/><t22/><t23/><t24/><t25/><t26/><t27/><t28/><t29/><t30/><t31/><t32/><t33/><t34/><t35/><t36/><t37/><t38/><t39/><t40/><t41/><t42/><t43/><t44/><meta><instanceID>uuid:3ad32f4a-ef55-4be3-8cd1-e5f0c6f97636</instanceID></meta></data>    1    5    2026-04-13 18:37:27.168+00    



COPY public.submission_field_extract_geo_cache (submission_def_id, fieldhash, geovalue) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.submissions (id, "formId", "instanceId", "createdAt", "updatedAt", "deletedAt", "submitterId", "deviceId", draft, "reviewState", event) FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "1"
LINE 1: 1 1 uuid:3ad32f4a-ef55-4be3-8cd1-e5f0c6f97636 2026-04-13 18:...
        ^
STATEMENT:  1    1    uuid:3ad32f4a-ef55-4be3-8cd1-e5f0c6f97636    2026-04-13 18:37:27.168+00    



COPY public.user_project_preferences ("userId", "projectId", "propertyName", "propertyValue") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COPY public.user_site_preferences ("userId", "propertyName", "propertyValue") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "5"
LINE 1: 5 mailingListOptIn true
        ^
STATEMENT:  5    mailingListOptIn    true
5    whatsNewDismissed    "2026.1"



COPY public.users ("actorId", password, email, "lastLoginAt") FROM stdin;
backslash commands are restricted; only \unrestrict is allowed
ERROR:  syntax error at or near "5"
LINE 1: 5 $2b$12$A5Y5kXJEapN7B/ns5eyH2OeQhzwKYp5ZGS4d8mgGmNbRHOK.d4J...
        ^
STATEMENT:  5    $2b$12$A5Y5kXJEapN7B/ns5eyH2OeQhzwKYp5ZGS4d8mgGmNbRHOK.d4JNO    sadiqkhoja@gmail.com    2026-04-13 18:36:59.244+00



SELECT pg_catalog.setval('public.actors_id_seq', 6, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.audits_id_seq', 10, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.blobs_id_seq', 2, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.comments_id_seq', 1, false);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.datasets_id_seq', 1, false);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.ds_properties_id_seq', 1, false);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.entities_id_seq', 1, false);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.entity_def_sources_id_seq', 1, false);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.entity_defs_id_seq', 1, false);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.form_defs_id_seq', 1, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.form_schemas_id_seq', 1, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.forms_id_seq', 1, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.keys_id_seq', 1, false);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.knex_migrations_id_seq', 210, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.knex_migrations_lock_index_seq', 1, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.projects_id_seq', 1, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public."purged_entities_auditId_seq"', 1, false);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.roles_id_seq', 9, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.submission_defs_id_seq', 1, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT pg_catalog.setval('public.submissions_id_seq', 1, true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.actees
    ADD CONSTRAINT actees_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.actors
    ADD CONSTRAINT actors_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.assignments
    ADD CONSTRAINT assignments_pkey PRIMARY KEY ("actorId", "roleId", "acteeId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.audits
    ADD CONSTRAINT audits_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.blobs
    ADD CONSTRAINT blobs_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.blobs
    ADD CONSTRAINT blobs_sha_content_type_unique UNIQUE (sha, "contentType");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.config
    ADD CONSTRAINT config_pkey PRIMARY KEY (key);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.dataset_form_defs
    ADD CONSTRAINT dataset_form_defs_datasetid_formdefid_unique UNIQUE ("datasetId", "formDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.datasets
    ADD CONSTRAINT datasets_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.ds_properties
    ADD CONSTRAINT ds_properties_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.ds_property_fields
    ADD CONSTRAINT ds_property_fields_dspropertyid_formdefid_unique UNIQUE ("dsPropertyId", "formDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.ds_property_fields
    ADD CONSTRAINT ds_property_fields_dspropertyid_path_formdefid_unique UNIQUE ("dsPropertyId", path, "formDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entities
    ADD CONSTRAINT entities_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entities
    ADD CONSTRAINT entities_uuid_unique UNIQUE (uuid);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_def_sources
    ADD CONSTRAINT entity_def_sources_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_defs
    ADD CONSTRAINT entity_defs_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_submission_backlog
    ADD CONSTRAINT "entity_submission_backlog_branchId_branchBaseVersion_key" UNIQUE ("branchId", "branchBaseVersion");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.field_keys
    ADD CONSTRAINT field_keys_pkey PRIMARY KEY ("actorId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_attachments
    ADD CONSTRAINT form_attachments_pkey PRIMARY KEY ("formDefId", name);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_defs
    ADD CONSTRAINT form_defs_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_fields
    ADD CONSTRAINT form_fields_pkey PRIMARY KEY ("schemaId", path);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_schemas
    ADD CONSTRAINT form_schemas_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.forms
    ADD CONSTRAINT forms_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.keys
    ADD CONSTRAINT keys_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.keys
    ADD CONSTRAINT keys_public_unique UNIQUE (public);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.knex_migrations_lock
    ADD CONSTRAINT knex_migrations_lock_pkey PRIMARY KEY (index);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.knex_migrations
    ADD CONSTRAINT knex_migrations_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_acteeid_unique UNIQUE ("acteeId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.public_links
    ADD CONSTRAINT public_links_pkey PRIMARY KEY ("actorId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.purged_entities
    ADD CONSTRAINT purged_entities_pkey PRIMARY KEY ("entityUuid");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.roles
    ADD CONSTRAINT roles_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_attachments
    ADD CONSTRAINT submission_attachments_pkey PRIMARY KEY ("submissionDefId", name);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_defs
    ADD CONSTRAINT submission_defs_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_field_extract_geo_cache
    ADD CONSTRAINT submission_field_extract_geo_cache_pkey PRIMARY KEY (submission_def_id, fieldhash);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submissions
    ADD CONSTRAINT submissions_formid_instanceid_draft_unique UNIQUE ("formId", "instanceId", draft);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submissions
    ADD CONSTRAINT submissions_pkey PRIMARY KEY (id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.user_project_preferences
    ADD CONSTRAINT user_project_preferences_primary_key PRIMARY KEY ("userId", "projectId", "propertyName");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.user_site_preferences
    ADD CONSTRAINT user_site_preferences_primary_key PRIMARY KEY ("userId", "propertyName");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_pkey PRIMARY KEY ("actorId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX actees_parent_index ON public.actees USING btree (parent);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX actors_displayname_gist_index ON public.actors USING gist ("displayName" public.gist_trgm_ops);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX actors_type_index ON public.actors USING btree (type);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX assignments_actorid_index ON public.assignments USING btree ("actorId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_acteeid_loggedat_index ON public.audits USING btree ("acteeId", "loggedAt");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_action_acteeid_loggedat_index ON public.audits USING btree (action, "acteeId", "loggedAt");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_actorid_action_loggedat_index ON public.audits USING btree ("actorId", action, "loggedAt");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_actorid_loggedat_index ON public.audits USING btree ("actorId", "loggedAt");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_claimed_processed_index ON public.audits USING btree (claimed, processed);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_details_entity_def_index ON public.audits USING hash ((((details ->> 'entityDefId'::text))::integer));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_details_entity_index ON public.audits USING hash ((((details ->> 'entityId'::text))::integer));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_details_entity_source_index ON public.audits USING hash ((((details ->> 'sourceId'::text))::integer));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_details_entity_uuid ON public.audits USING hash ((((details -> 'entity'::text) ->> 'uuid'::text))) WHERE (action = ANY (ARRAY['entity.create'::text, 'entity.update'::text, 'entity.update.version'::text, 'entity.update.resolve'::text, 'entity.delete'::text, 'entity.restore'::text]));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_details_entity_uuid_index ON public.audits USING hash ((((details -> 'entity'::text) ->> 'uuid'::text)));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_details_entityuuids ON public.audits USING gin (((details -> 'entityUuids'::text)) jsonb_path_ops) WHERE (action = ANY (ARRAY['entity.purge'::text, 'entity.bulk.delete'::text, 'entity.bulk.restore'::text]));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX audits_details_submission_index ON public.audits USING hash ((((details -> 'submissionId'::text))::integer));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX blobs_sha_index ON public.blobs USING btree (sha);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX client_audits_start_index ON public.client_audits USING btree (start);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX comments_submissionid_index ON public.comments USING btree ("submissionId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX dataset_projectid_name_deletedat_unique ON public.datasets USING btree ("projectId", name) WHERE ("deletedAt" IS NULL);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX ds_properties_datasetid_name_deletedat_unique ON public.ds_properties USING btree ("datasetId", name) WHERE ("deletedAt" IS NULL);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entities_conflict_idx ON public.entities USING btree (conflict);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entities_datasetid_createdat_id_index ON public.entities USING btree ("datasetId", "createdAt", id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entities_datasetid_creatorid_updatedat_index ON public.entities USING btree ("datasetId", "creatorId", "updatedAt");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entities_deletedat_index ON public.entities USING btree ("deletedAt");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entity_defs_entityid_current_index ON public.entity_defs USING btree ("entityId", current);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entity_defs_has_geometry ON public.entity_defs USING btree (id) WHERE ((data ? 'geometry'::text) AND ((data ->> 'geometry'::text) ~ '\d'::text));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entity_defs_search_index ON public.entity_defs USING gin (((jsonb_to_tsvector('simple'::regconfig, data, '["string"]'::jsonb) || to_tsvector('simple'::regconfig, label)))) WHERE (current = true);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX entity_defs_sourceid_index ON public.entity_defs USING btree ("sourceId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX field_keys_actorid_projectid_index ON public.field_keys USING btree ("actorId", "projectId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX form_attachments_formid_index ON public.form_attachments USING btree ("formId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX form_defs_formid_publishedat_index ON public.form_defs USING btree ("formId", "publishedAt");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX form_field_values_formid_index ON public.form_field_values USING btree ("formId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX form_field_values_formid_submissiondefid_path_index ON public.form_field_values USING btree ("formId", "submissionDefId", path);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX form_field_values_submissiondefid_index ON public.form_field_values USING btree ("submissionDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX form_fields_formid_path_type_index ON public.form_fields USING btree ("formId", path, type);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX form_fields_schemaid_binary_index ON public.form_fields USING btree ("schemaId", "binary");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX form_fields_schemaid_order_index ON public.form_fields USING btree ("schemaId", "order");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX forms_deletedat_state_index ON public.forms USING btree ("deletedAt", state);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX forms_projectid_xmlformid_deletedat_unique ON public.forms USING btree ("projectId", "xmlFormId") WHERE ("deletedAt" IS NULL);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX forms_xmlformid_index ON public.forms USING btree ("xmlFormId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX idx_fk_actors_acteeid ON public.actors USING btree ("acteeId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_assignments_acteeid ON public.assignments USING btree ("acteeId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_assignments_roleid ON public.assignments USING btree ("roleId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_client_audits_blobid ON public.client_audits USING btree ("blobId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_comments_actorid ON public.comments USING btree ("actorId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_config_blobid ON public.config USING btree ("blobId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_dataset_form_defs_formdefid ON public.dataset_form_defs USING btree ("formDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_datasets_projectid ON public.datasets USING btree ("projectId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_ds_properties_datasetid ON public.ds_properties USING btree ("datasetId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_entities_creatorid ON public.entities USING btree ("creatorId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX idx_fk_entity_def_sources_auditid ON public.entity_def_sources USING btree ("auditId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_entity_def_sources_submissiondefid ON public.entity_def_sources USING btree ("submissionDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_entity_submission_backlog_auditid ON public.entity_submission_backlog USING btree ("auditId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_entity_submission_backlog_submissiondefid ON public.entity_submission_backlog USING btree ("submissionDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_entity_submission_backlog_submissionid ON public.entity_submission_backlog USING btree ("submissionId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_field_keys_createdby ON public.field_keys USING btree ("createdBy");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_field_keys_projectid ON public.field_keys USING btree ("projectId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_form_attachments_blobid ON public.form_attachments USING btree ("blobId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_form_attachments_datasetid ON public.form_attachments USING btree ("datasetId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_form_defs_keyid ON public.form_defs USING btree ("keyId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_form_defs_schemaid ON public.form_defs USING btree ("schemaId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_form_defs_xlsblobid ON public.form_defs USING btree ("xlsBlobId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX idx_fk_forms_acteeid ON public.forms USING btree ("acteeId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX idx_fk_forms_currentdefid ON public.forms USING btree ("currentDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX idx_fk_forms_draftdefid ON public.forms USING btree ("draftDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_forms_projectid ON public.forms USING btree ("projectId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX idx_fk_projects_keyid ON public.projects USING btree ("keyId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_public_links_createdby ON public.public_links USING btree ("createdBy");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_public_links_formid ON public.public_links USING btree ("formId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_submission_attachments_blobid ON public.submission_attachments USING btree ("blobId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_submission_defs_formdefid ON public.submission_defs USING btree ("formDefId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_submission_defs_submitterid ON public.submission_defs USING btree ("submitterId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_submissions_submitterid ON public.submissions USING btree ("submitterId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX idx_fk_user_project_preferences_projectid ON public.user_project_preferences USING btree ("projectId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX keys_public_index ON public.keys USING btree (public);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX purged_entities_actee_uuid_index ON public.purged_entities USING btree ("acteeId", "entityUuid");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX roles_verbs_gin_index ON public.roles USING gin (verbs jsonb_path_ops);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX sessions_actorid_expires_index ON public.sessions USING btree ("actorId", "expiresAt");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX sessions_token_index ON public.sessions USING btree (token);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX submission_defs_createdat_id_index ON public.submission_defs USING btree ("createdAt", id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX submission_defs_submissionid_current_index ON public.submission_defs USING btree ("submissionId", current);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX submission_defs_submissionid_instanceid_index ON public.submission_defs USING btree ("submissionId", "instanceId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE UNIQUE INDEX submission_event_idx ON public.submissions USING btree (event);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX submission_field_extract_geo_cache_non_null_geovalue ON public.submission_field_extract_geo_cache USING btree (((geovalue IS NOT NULL)));
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX submissions_formid_createdat_id_index ON public.submissions USING btree ("formId", "createdAt", id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX "submissions_reviewState_idx" ON public.submissions USING btree ("reviewState");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX "user_project_preferences_userId_idx" ON public.user_project_preferences USING btree ("userId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX "user_site_preferences_userId_idx" ON public.user_site_preferences USING btree ("userId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX users_email_gist_index ON public.users USING gist (email public.gist_trgm_ops);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE INDEX users_email_index ON public.users USING btree (email);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TRIGGER blank_submissions_event_on_update BEFORE UPDATE ON public.submissions FOR EACH ROW WHEN (((new.event IS NOT NULL) AND (old.event IS NOT NULL))) EXECUTE FUNCTION public.blank_submissions_event_triggerfunction();
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON TRIGGER blank_submissions_event_on_update ON public.submissions IS '{"dbsamizdat": {"version": 1, "definition_hash": "c6d9c9e5191fa009a63a4155620f8eb2"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TRIGGER check_email BEFORE INSERT OR UPDATE ON public.users FOR EACH ROW EXECUTE FUNCTION public.check_email();
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TRIGGER check_form_state BEFORE INSERT OR UPDATE ON public.forms FOR EACH ROW EXECUTE FUNCTION public.check_form_state();
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TRIGGER check_form_version AFTER INSERT OR UPDATE ON public.form_defs FOR EACH ROW EXECUTE FUNCTION public.check_form_version();
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TRIGGER check_instanceid_unique AFTER INSERT ON public.submission_defs FOR EACH ROW EXECUTE FUNCTION public.check_instanceid_unique();
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TRIGGER check_managed_key AFTER INSERT OR UPDATE ON public.form_defs FOR EACH ROW EXECUTE FUNCTION public.check_managed_key();
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE TRIGGER check_review_state BEFORE INSERT OR UPDATE ON public.submissions FOR EACH ROW EXECUTE FUNCTION public.check_review_state();
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  CREATE CONSTRAINT TRIGGER set_eventstamp_submissions_at_commit AFTER INSERT OR UPDATE ON public.submissions DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((new.event IS NULL)) EXECUTE FUNCTION public.eventstamp_submissions_triggerfunction();
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  COMMENT ON TRIGGER set_eventstamp_submissions_at_commit ON public.submissions IS '{"dbsamizdat": {"version": 1, "definition_hash": "9bc8ef789e6e8cd458dccc98b88b0db9"}}';
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.actors
    ADD CONSTRAINT actors_acteeid_foreign FOREIGN KEY ("acteeId") REFERENCES public.actees(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.assignments
    ADD CONSTRAINT assignments_acteeid_foreign FOREIGN KEY ("acteeId") REFERENCES public.actees(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.assignments
    ADD CONSTRAINT assignments_actorid_foreign FOREIGN KEY ("actorId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.assignments
    ADD CONSTRAINT assignments_roleid_foreign FOREIGN KEY ("roleId") REFERENCES public.roles(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_attachments
    ADD CONSTRAINT attachments_blobid_foreign FOREIGN KEY ("blobId") REFERENCES public.blobs(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.audits
    ADD CONSTRAINT audits_acteeid_foreign FOREIGN KEY ("acteeId") REFERENCES public.actees(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.audits
    ADD CONSTRAINT audits_actorid_foreign FOREIGN KEY ("actorId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.client_audits
    ADD CONSTRAINT client_audits_blobid_foreign FOREIGN KEY ("blobId") REFERENCES public.blobs(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_actorid_foreign FOREIGN KEY ("actorId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_submissionid_foreign FOREIGN KEY ("submissionId") REFERENCES public.submissions(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.config
    ADD CONSTRAINT config_blobid_foreign FOREIGN KEY ("blobId") REFERENCES public.blobs(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.dataset_form_defs
    ADD CONSTRAINT dataset_form_defs_datasetid_foreign FOREIGN KEY ("datasetId") REFERENCES public.datasets(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.dataset_form_defs
    ADD CONSTRAINT dataset_form_defs_formdefid_foreign FOREIGN KEY ("formDefId") REFERENCES public.form_defs(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.datasets
    ADD CONSTRAINT datasets_projectid_foreign FOREIGN KEY ("projectId") REFERENCES public.projects(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.ds_properties
    ADD CONSTRAINT ds_properties_datasetid_foreign FOREIGN KEY ("datasetId") REFERENCES public.datasets(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.ds_property_fields
    ADD CONSTRAINT ds_property_fields_dspropertyid_foreign FOREIGN KEY ("dsPropertyId") REFERENCES public.ds_properties(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entities
    ADD CONSTRAINT entities_createdby_foreign FOREIGN KEY ("creatorId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entities
    ADD CONSTRAINT entities_datasetid_foreign FOREIGN KEY ("datasetId") REFERENCES public.datasets(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_def_sources
    ADD CONSTRAINT entity_def_sources_auditid_foreign FOREIGN KEY ("auditId") REFERENCES public.audits(id) ON DELETE SET NULL;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_def_sources
    ADD CONSTRAINT entity_def_sources_submissiondefid_foreign FOREIGN KEY ("submissionDefId") REFERENCES public.submission_defs(id) ON DELETE SET NULL;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_defs
    ADD CONSTRAINT entity_defs_entityid_foreign FOREIGN KEY ("entityId") REFERENCES public.entities(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_defs
    ADD CONSTRAINT entity_defs_sourceid_foreign FOREIGN KEY ("sourceId") REFERENCES public.entity_def_sources(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.field_keys
    ADD CONSTRAINT field_keys_actorid_foreign FOREIGN KEY ("actorId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.field_keys
    ADD CONSTRAINT field_keys_createdby_foreign FOREIGN KEY ("createdBy") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.field_keys
    ADD CONSTRAINT field_keys_projectid_foreign FOREIGN KEY ("projectId") REFERENCES public.projects(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_submission_backlog
    ADD CONSTRAINT fk_audit_id FOREIGN KEY ("auditId") REFERENCES public.audits(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_submission_backlog
    ADD CONSTRAINT fk_submission_defs FOREIGN KEY ("submissionDefId") REFERENCES public.submission_defs(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.entity_submission_backlog
    ADD CONSTRAINT fk_submissions FOREIGN KEY ("submissionId") REFERENCES public.submissions(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_attachments
    ADD CONSTRAINT form_attachments_blobid_foreign FOREIGN KEY ("blobId") REFERENCES public.blobs(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_attachments
    ADD CONSTRAINT form_attachments_datasetid_foreign FOREIGN KEY ("datasetId") REFERENCES public.datasets(id) ON DELETE SET NULL;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_attachments
    ADD CONSTRAINT form_attachments_formdefid_foreign FOREIGN KEY ("formDefId") REFERENCES public.form_defs(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_attachments
    ADD CONSTRAINT form_attachments_formid_foreign FOREIGN KEY ("formId") REFERENCES public.forms(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_defs
    ADD CONSTRAINT form_defs_formid_foreign FOREIGN KEY ("formId") REFERENCES public.forms(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_defs
    ADD CONSTRAINT form_defs_keyid_foreign FOREIGN KEY ("keyId") REFERENCES public.keys(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_defs
    ADD CONSTRAINT form_defs_schemaid_foreign FOREIGN KEY ("schemaId") REFERENCES public.form_schemas(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_defs
    ADD CONSTRAINT form_defs_xlsblobid_foreign FOREIGN KEY ("xlsBlobId") REFERENCES public.blobs(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_field_values
    ADD CONSTRAINT form_field_values_formid_foreign FOREIGN KEY ("formId") REFERENCES public.forms(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_field_values
    ADD CONSTRAINT form_field_values_submissiondefid_foreign FOREIGN KEY ("submissionDefId") REFERENCES public.submission_defs(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_fields
    ADD CONSTRAINT form_fields_formid_foreign FOREIGN KEY ("formId") REFERENCES public.forms(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.form_fields
    ADD CONSTRAINT form_fields_schemaid_foreign FOREIGN KEY ("schemaId") REFERENCES public.form_schemas(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.forms
    ADD CONSTRAINT forms_acteeid_foreign FOREIGN KEY ("acteeId") REFERENCES public.actees(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.forms
    ADD CONSTRAINT forms_currentdefid_foreign FOREIGN KEY ("currentDefId") REFERENCES public.form_defs(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.forms
    ADD CONSTRAINT forms_draftdefid_foreign FOREIGN KEY ("draftDefId") REFERENCES public.form_defs(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.forms
    ADD CONSTRAINT forms_projectid_foreign FOREIGN KEY ("projectId") REFERENCES public.projects(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_keyid_foreign FOREIGN KEY ("keyId") REFERENCES public.keys(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.public_links
    ADD CONSTRAINT public_links_actorid_foreign FOREIGN KEY ("actorId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.public_links
    ADD CONSTRAINT public_links_createdby_foreign FOREIGN KEY ("createdBy") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.public_links
    ADD CONSTRAINT public_links_formid_foreign FOREIGN KEY ("formId") REFERENCES public.forms(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.sessions
    ADD CONSTRAINT sessions_actorid_foreign FOREIGN KEY ("actorId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_attachments
    ADD CONSTRAINT submission_attachments_submissiondefid_foreign FOREIGN KEY ("submissionDefId") REFERENCES public.submission_defs(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_defs
    ADD CONSTRAINT submission_defs_actorid_foreign FOREIGN KEY ("submitterId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_defs
    ADD CONSTRAINT submission_defs_formdefid_foreign FOREIGN KEY ("formDefId") REFERENCES public.form_defs(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_defs
    ADD CONSTRAINT submission_defs_submissionid_foreign FOREIGN KEY ("submissionId") REFERENCES public.submissions(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submission_field_extract_geo_cache
    ADD CONSTRAINT submission_field_extract_geo_cache_submission_def_id_fkey FOREIGN KEY (submission_def_id) REFERENCES public.submission_defs(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submissions
    ADD CONSTRAINT submissions_formid_foreign FOREIGN KEY ("formId") REFERENCES public.forms(id) ON DELETE CASCADE;
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.submissions
    ADD CONSTRAINT submissions_submitter_foreign FOREIGN KEY ("submitterId") REFERENCES public.actors(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.user_project_preferences
    ADD CONSTRAINT "user_project_preferences_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES public.projects(id);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.user_project_preferences
    ADD CONSTRAINT "user_project_preferences_userId_fkey" FOREIGN KEY ("userId") REFERENCES public.users("actorId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.user_site_preferences
    ADD CONSTRAINT "user_site_preferences_userId_fkey" FOREIGN KEY ("userId") REFERENCES public.users("actorId");
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_actorid_foreign FOREIGN KEY ("actorId") REFERENCES public.actors(id);


    Success. You will have to log out of the site, and then log back in.
    IMPORTANT: Everything has been restored to the way things were at the time of backup, including:
    * all passwords and email addresses.
    * anything deleted since the backup was made — such things now exist again.
    Please revisit all of these and make sure they are okay.

Repro of the third issue:

`% node lib/bin/restore.js ~/freshbkOnMasterWithPP.zip '123123'`
Error: process exited with code: 1, spawnfile: pg_restore, args: pg_restore,--no-acl,--no-owner,--exit-on-error,--format,d,--file,-,/private/var/folders/6b/t9d6bf4j04z0_w8mvx8p88p80000gn/T/tmp-66384-Re6Vo77PbReg
    at awaitSpawnee (/Users/sadiq/Repos/central-backend/lib/util/process.js:8:17)
    at async Promise.all (index 0)
    at async tmp.withDir.unsafeCleanup (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:55:5)
    at async Object.withDir (/Users/sadiq/Repos/central-backend/node_modules/tmp-promise/index.js:37:12)
    at async restoreFromLegacyZipFile (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:51:3)
    at async main (/Users/sadiq/Repos/central-backend/lib/bin/restore.js:77:5) {
  exitcode: 1
}

if I put a wrong passphrase then I see Problem [Error]: Could not perform decryption. Double check your passphrase and your data and try again..

Upon further digging, it turned our that original backup was created using pg_dump 17.5 and when I ran pg_restore --no-acl --no-owner --exit-on-error --format=d --file=- /Users/sadiq/extracted I got pg_restore: error: unsupported version (1.16) in file header. It tells me that we need some error handling in/around getRestoreStreamFromDumpDir so that user could see the issue. In practice, this issue shouldn't occur if users are using central in typical docker-way, so we can ignore this problem.

@brontolosone
Copy link
Copy Markdown
Contributor Author

Issue 1: during backup, any errors should be clientside detectable

We seem to consider this solved now then! You say:

Now the solution you have proposed of sending Null chunk to signal broken stream is perfect but I couldn't verify it locally, maybe I'm doing something wrong (should we setup a call?):

❗ Note that it works the opposite way: to signal a broken stream, you end it without sending a null chunk.

To see it in action you could also take a look at this test of getodk/central#1737 .

Issue 2: not all errors result in non-success status, or at least, we find a success message printed even while we also find errors printed

I couldn't repro getting a success message under error conditions, but I did change things around to explicitly catch a stream error occurring "in node" when thing go sideways (eg, in pg_restore when its target DB doesn't exist, or restoring an archive made with pg_dump18 using pg_dump14). The crux of it, to my understanding: with these Node streams, it's not really actually pg_dump that pipes into pg_restore, rather it's pg_dump | node | pg_restore, so it follows that it'll be node getting the SIGPIPE if pg_restore aborts, which will be handled first (before the pg_restore abnormal process exit can be handled). This is in contrast to the "normal" situation, ie when you use unix pipes, because there it'd be pg_dump receiving the SIGPIPE, and we'd see its abnormal exit and would be able to keep things simple and just react to those process exit statuses alone.

Anyhow, with some amendments, instead of just letting things run their course and counting on that the error messages will be noted, we now complain more loudly and visibly to the user, as not every user might monitor the exit status (or the chatter on stderr) when they run restore.js.

Unless there's still some unmonitored stream somewhere, I think you should now be seeing either the success message or an ominous "DATABASE RESTORE FAILED" message...

@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch from bd57233 to f6b07e6 Compare April 27, 2026 07:08
@brontolosone brontolosone force-pushed the db-conf-and-db-backup-03 branch from f6b07e6 to dbd0d77 Compare April 27, 2026 07:27
@brontolosone brontolosone requested a review from sadiqkhoja April 27, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improved backup format (and DB dump/restore procedure) Futile re-compression of already-compressed DB object dumps

4 participants