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 FUNCTION
CREATE TABLE
seq_name | sequence_currval |
---|---|
public.foo_id_seq | 0 |
SELECT 1
ERROR: currval of sequence "foo_id_seq" is not yet defined in this session
ERROR: lastval is not yet defined in this session
last_value | log_cnt | is_called |
---|---|---|
1 | 0 | f |
SELECT 1
INSERT 0 1
lastval | currval |
---|---|
1 | 1 |
SELECT 1
last_value | log_cnt | is_called |
---|---|---|
1 | 32 | t |
SELECT 1
sequence_currval |
---|
1 |
SELECT 1
INSERT 0 1
lastval | currval |
---|---|
2 | 2 |
SELECT 1
sequence_currval |
---|
2 |
SELECT 1
last_value | log_cnt | is_called |
---|---|---|
2 | 31 | t |
SELECT 1