June 2024
Intermediate to advanced
456 pages
11h 34m
English
Let’s practice some of the backfill techniques you’ve seen.
Using the earlier example that added a city_id column to the users table, imagine that you were creating a purpose-built intermediate table to act as the data source.
This table has these characteristics:
Run these statements in psql:
| | CREATE SCHEMA IF NOT EXISTS temp; |
| | |
| | CREATE UNLOGGED TABLE temp.users_intermediate ( |
| | user_id BIGINT, city_id INTEGER |
| | ); |
| | |
| | ALTER TABLE temp.users_intermediate |
| | SET (autovacuum_enabled = false); |
Generate some ...
Read now
Unlock full access