TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Postgres Unlogged Tables

85 pointsby plaur782over 2 years ago

6 comments

tremonover 2 years ago
<i>should someone literally pull the plug on your Postgres database server, your data is 100% safe, except for unlogged tables, in which your data is 100% gone - by design!</i><p>This omits a crucial fact: your data is not gone until Postgresql has gone through its startup recovery phase. If you really need to recover unlogged table data (to which every proper database administrator will rightly say &quot;then WhyTH did you make it unlogged&quot;), you should capture the table files <i>before</i> starting the database server again. And then pay through the nose for a data recovery specialist.<p><i>However, a crash will truncate it.</i><p>So this isn&#x27;t exactly true. A crash <i>recovery</i> will truncate it.
评论 #34850034 未加载
评论 #34849009 未加载
评论 #34849346 未加载
评论 #34853436 未加载
BeefySwainover 2 years ago
Very well written and detailed article, with the caveat that they never mention a use case they consider legitimate. Does anyone here have any uses? I could imagine some sort of ETL type tasks which are transient could make sense. Thoughts?
评论 #34851806 未加载
评论 #34850242 未加载
评论 #34850083 未加载
评论 #34850001 未加载
评论 #34852923 未加载
评论 #34853474 未加载
jonstewartover 2 years ago
Does COPY FROM sidestep the WAL? My (perhaps incorrect) understanding is that pg writes such data to a table file then uses a small transaction to make it live.
评论 #34849316 未加载
chuckledogover 2 years ago
Seems like bulk loading might be a good use case here.
评论 #34854126 未加载
评论 #34850583 未加载
评论 #34858188 未加载
评论 #34850041 未加载
lazyantover 2 years ago
can we have &quot;best of both worlds&quot; for inserting a lot of data quickly, to have an unlogged table for performance and a trigger to copy data to another regular table for permanence?
评论 #34852885 未加载
sebazzzover 2 years ago
So similar use cases as MSSQL in-memory tables?