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?.
1 rows affected
1 rows affected
1 rows affected
1 rows affected
manager_name s
man_1 75
man_2 99
ERROR:  new row for relation "portfolio" violates check constraint "portfolio_check1"
DETAIL:  Failing row contains (man_1, 500, 2000-01-04, 575, 2020-01-03, 75).

ERROR:  new row for relation "portfolio" violates check constraint "portfolio_total_amount_check"
DETAIL:  Failing row contains (man_1, 26, 2020-01-05, 101, 2020-01-03, 75).

manager_name loan_amount change_date total_amount previous_change_date previous_total_amount
man_1 20 2020-01-01 20 null null
man_1 25 2020-01-02 45 2020-01-01 20
man_1 30 2020-01-03 75 2020-01-02 45
man_2 99 2020-10-01 99 null null
1 rows affected
manager_name loan_amount change_date total_amount previous_change_date previous_total_amount
man_1 20 2020-01-01 20 null null
man_1 25 2020-01-02 45 2020-01-01 20
man_1 30 2020-01-03 75 2020-01-02 45
man_1 25 2020-01-05 100 2020-01-03 75
man_2 99 2020-10-01 99 null null