add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
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
ALTER TABLE
CREATE VIEW
CREATE TABLE
CREATE TABLE
CREATE FUNCTION
CREATE TRIGGER
INSERT 0 2
INSERT 0 3
INSERT 0 8
UPDATE 1
UPDATE 2
config revision deployed status names
config_foo 1 t other.name, some.name
config_foo 2 t ACTIVE other.name, revised.name, third.name
config_bar 1 f other.name, some.name, unique.name
SELECT 3
ERROR:  duplicate key value violates unique constraint "published_public_name_name_key"
DETAIL:  Key (name)=(other.name) already exists.
CONTEXT:  SQL statement "INSERT INTO published_public_name(config_id, name)
    SELECT NEW.id, pn.name
    FROM public_name pn
    WHERE pn.revision_id = NEW.current_revision_id
    ORDER BY pn.name"
PL/pgSQL function copy_published_public_names() line 23 at SQL statement
config revision deployed status names
config_foo 1 t other.name, some.name
config_foo 2 t ACTIVE other.name, revised.name, third.name
config_bar 1 f other.name, some.name, unique.name
SELECT 3
UPDATE 1
UPDATE 1
UPDATE 1
config revision deployed status names
config_foo 1 t other.name, some.name
config_foo 2 t other.name, revised.name, third.name
config_bar 1 t ACTIVE other.name, some.name, unique.name
SELECT 3