Questions tagged [unlogged-tables]

7 questions
9
votes
2 answers

Disadvantages of unlogged tables

To make updates faster, I am using: ALTER TABLE imagingresourceplanning.opnav_fact_revenue_costs SET UNLOGGED ; What are the drawbacks of this command? What will happen if system crashes during the update? Is all the data present in the table…
user2274074
  • 473
  • 3
  • 8
  • 14
8
votes
2 answers

Set PostgreSQL table to LOGGED after data loading

I have created an empty UNLOGGED table to faster copy a large amount of data (over 1 Billion rows). Loading the data took around 4 hours. Now I want to set the table to LOGGED to make it safe for unexpected shutdowns and crashes. This process takes…
Michael
  • 295
  • 1
  • 4
  • 16
2
votes
2 answers

Unable to alter partition table to set logged

I have a partition table that I created UNLOGGED. I'm using pg_partman to manage the partition. I then proceeded to load data into it with a COPY command. Afterwards, I ran an alter table set logged on the parent table but the table still shows as…
1
vote
1 answer

Is a Postgresql UNLOGGED table completely lost on process crash?

I use UNLOGGED tables for a few very large tables in a data warehouse style application. Until recently, I understood UNLOGGED to mean “won’t write to the WAL” - which in turn means that recent changes maybe lost on a process crash / unclean…
mzpq
  • 165
  • 7
1
vote
2 answers

Empty table after pg_restore

I have a backup of an unlogged table called potential_users, the relation has 58677237 records in it. Steps: pg_dump --format custom --verbose --file "potential_users.backup" --table "public.potential_users" productiondb pg_restore -a -t…
Imanol Y.
  • 785
  • 2
  • 10
  • 28
0
votes
0 answers

PostgreSQL - Bulk COPY slower with unlogged tables than logged tables

We have an ETL process that starts with loading data into PostgresSQL 16.2 databases (Azure Database for PostgreSQL flexible). We load 100,000 records at a time using COPY FROM STDIN. This is staging data that doesn't need to be recovered in case of…
0
votes
1 answer

is it safe to have an unlogged table on the ram disk?

I need to create a table for caching in the postgresql database. Transactions should be as fast as possible, so i thought of creating unlogged table and have a RAM disk as it's tablespace. There is a warning in the official postgresql…