Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Error on restore into doltgres (pg_restore) #843

Open
VikramChennai opened this issue Oct 11, 2024 · 3 comments
Open

Error on restore into doltgres (pg_restore) #843

VikramChennai opened this issue Oct 11, 2024 · 3 comments

Comments

@VikramChennai
Copy link

Error restoring database: pg_restore: connecting to database for restore
pg_restore: error: query failed: ERROR: function: 'set_config' not found (errno 1105) (sqlstate HY000)
pg_restore: detail: Query was: SELECT pg_catalog.set_config('search_path', '', false);

What i was running:

pg_restore_command = [
PG_RESTORE_PATH,
f"--dbname={connection_uri}",
"--no-owner",
"--no-privileges",
"--clean",
"--if-exists",
"-v",
dump_file_path
]

@zachmu
Copy link
Member

zachmu commented Oct 11, 2024

Hi Vikram,

Getting pg_dump restores working is an ongoing piece of work for us. We can implement the missing set_config function pretty easily, but it's likely there would be additional problems with your restore command after that. But, we could probably knock them all out for you at once if you'd be willing to share your dump file with us.

Zach

@fulghum
Copy link
Contributor

fulghum commented Oct 14, 2024

Thanks for sharing the dump file with us via Discord. I've been digging in and found a few interesting things already...

One callout is that Doltgres does not support user defined functions yet, but it's on our radar and something we want to get to soon. Here's the tracking issue for that work: #756

I've found a few issues with identifier quoting – I've patched the nextval function and the COPY statement locally to fix that, and have been able to get a bit farther with the data loading. I'll get those fixes cleaned up, add some tests, and open PRs for those.

I'll keep digging in and let you know what else we find here.

@fulghum
Copy link
Contributor

fulghum commented Oct 14, 2024

A couple more updates on this one...

#852 is the tracking issue for set_config() support.

I just merged in #851, which contains a couple small fixes for double-quoted identifier parsing that your SQL dump needs.

I started digging into another issue I identified, but I don't have a fix yet. I opened #850 to track that work and will keep digging in deeper there.

I also noticed that the dump file contains CREATE PUBLICATION and ALTER PUBLICATION statements. Doltgres doesn't support publications currently, and my understanding is that this feature is only used for replication. My guess is that your app probably doesn't need these on Doltgres, but let us know if you do need publication support for any reason and we'll be happy to open a tracking issue for it and start scoping the work.

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

No branches or pull requests

3 participants