By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
CREATE TABLE
CREATE TABLE
CREATE TABLE
INSERT 0 10
CREATE FUNCTION
CREATE AGGREGATE
CREATE FUNCTION
row_num | id | str | val |
---|---|---|---|
1 | 1 | 1a | null |
2 | 1 | 1a | 1 |
3 | 2 | 2a | 2 |
4 | 2 | 2a | 2 |
5 | 3 | null | null |
6 | 3 | 3a | 31 |
7 | 3 | 3a | 31 |
8 | 3 | 3a | 32 |
9 | 3 | 3b | 32 |
10 | 3 | 3b | 32 |
SELECT 10
CREATE FUNCTION
nullable_columns | updated_rows |
---|---|
2 | 6 |
SELECT 1
row_num | id | str | val |
---|---|---|---|
1 | 1 | 1a | null |
2 | 1 | 1a | 1 |
3 | 2 | 2a | 2 |
4 | 2 | 2a | 2 |
5 | 3 | null | null |
6 | 3 | 3a | 31 |
7 | 3 | 3a | 31 |
8 | 3 | 3a | 32 |
9 | 3 | 3b | 32 |
10 | 3 | 3b | 32 |
SELECT 10
ERROR: No nullable columns found in table >>empty<< CONTEXT: PL/pgSQL function f_gap_fill_update(regclass,text,text) line 33 at RAISE
ERROR: No nullable columns found in table >>all_notnull<< CONTEXT: PL/pgSQL function f_gap_fill_update(regclass,text,text) line 33 at RAISE