DEV Community

Loïc
Loïc

Posted on

1

👮‍♀️IMMUTABLE Tables👮‍♂️

IMMUTABLE table example

👉 IMMUTABLE tables: Insert-only tables in which existing data cannot be modified. Deleting rows is either prohibited or restricted based on the insertion time of the rows.

☝ an example of such an IMMUTABLE table used to store orders as JSON data. You may (for legal reasons) be able to delete data but only after waiting for 30 days. Also, you can drop the table but only after 16 days without any activity on it. Setting the database parameter blockchain_table_max_no_drop to 0 before creating such tables can help for dev/test! Finally, you can use DBMS_IMMUTABLE_TABLE.DELETE_EXPIRED_ROWS to delete expired rows.

⚠ feature backported to 19.11 version.

Learn more:

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay