Skip to content

[Feature request] - Add support for UNLOGGED #184

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

Closed
ketan-mck opened this issue Feb 20, 2024 · 3 comments
Closed

[Feature request] - Add support for UNLOGGED #184

ketan-mck opened this issue Feb 20, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ketan-mck
Copy link

I'm not sure if this is the right place for it, or if this should go to the main repo. Please advice.

I'm looking to import huge amounts of data from parquet to postgres via duckdb. This seems like the perfect tool for the job. I was looking to see if there's a way that I could use unlogged tables (Unlogged tables disable WAL to significantly improve write speeds).

I tried the following snippets to no avail:

INSTALL postgres;
SET pg_debug_show_queries=true;
SET pg_pages_per_task=10000;
ATTACH 'dbname=mydb' AS mydb (TYPE postgres);
DROP TABLE IF EXISTS mydb.userdata1;
CREATE UNLOGGED TABLE mydb.userdata1 AS FROM (SELECT * FROM 'foo.parquet' LIMIT 0);

However, it seems to simply ignore the UNLOGGED keyword. Is there any possibility to "escape out" to execute native postgresql? I'm happy to do ALTER TABLE ... SET UNLOGGED via native postgresql query as well.

Thanks

@Mytherin
Copy link
Contributor

Thanks for the suggestion!

I have thought about adding support for a postgres_execute function that allows you to execute arbitrary SQL within Postgres, would that work for you?

e.g.:

CALL postgres_execute('mydb', 'ALTER TABLE userdata1 SET UNLOGGED');

@ketan-mck
Copy link
Author

That would absolutely work fine, and very much in line with what I was hoping/expecting. It would not be practical for duckdb to expose every single SQL feature. Where there are gaps between the different SQL dialects, going down to native SQL would be absolutely perfect.

@Mytherin Mytherin added the enhancement New feature or request label Feb 26, 2024
@Mytherin
Copy link
Contributor

Implemented in #193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants