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?.
version
PostgreSQL 12.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit
2 rows affected
ERROR:  new row for relation "test" violates check constraint "ip_v6_regexp_ck"
DETAIL:  Failing row contains (4001:XXXX:2222:FFF0:0000:8a2e:0370:7334, host_3, 4001, 4001:XXXX:2222:FFF0:0000:8a2e:0370:7334).

1 rows affected
Token 1 Token 2 IPv6: Host:
2001 0db8 2001:0db8:0000:FFF0:0000:8a2e:0370:7334 host_1
10 9 10:9:8:7:6:6:7:6 host_2
4001 1111 4001:1111:2222:FFF0:0000:8a2e:0370:7334 host_3
6 rows affected
t_id token_1 token_2
1 2001 9
2 2001 9
3 2001 1111
4 10 1111
5 4001 0db8
6 2001 9
1 rows affected
t_id token_1 token_2
1 2001 9
2 2001 9
6 2001 9
ERROR:  new row for relation "test" violates check constraint "ip_v6_regexp_ck"
DETAIL:  Failing row contains (123:123::123, host_2, 123, 123).

1 rows affected
t_id token_1 token_2
1 2001 654
2 2001 654
6 2001 654
ip_v6 host ip_v6_token_1 ip_v6_token_2
2001:0db8:0000:FFF0:0000:8a2e:0370:7334 host_1 2001 0db8
987:654:321:123:123:123:123:123 host_2 987 654
1 rows affected
t_id token_1 token_2
1 2001 654
2 2001 654
6 2001 654
7 2001 0db8
ERROR:  insert or update on table "test_fk" violates foreign key constraint "test_fk_test_ip_v6_token_2_fk"
DETAIL:  Key (token_2)=(5432) is not present in table "test".

regexp_replace
YYYYY:0db8:0000:FFF0:0000:8a2e:0370:7334
YYYYY:654:321:123:123:123:123:123
regexp_replace
123:0db8:0000:FFF0:0000:8a2e:0370:7334
123:654:321:123:123:123:123:123
regexp_replace
001:0db8:0000:FFF0:0000:8a2e:0370:7334
87:654:321:123:123:123:123:123
RR_test
:
Rep text 2 ip_v6 Rep text 3 ip_v6
FFF0:0000:8a2e:0370:7334 xx 0000 0db8 2001 2001:0db8:0000:FFF0:0000:8a2e:0370:7334 0000:FFF0:0000:8a2e:0370:7334 0db8 2001 2001:0db8:0000:FFF0:0000:8a2e:0370:7334
123:123:123:123:123 xx 321 654 987 987:654:321:123:123:123:123:123 321:123:123:123:123:123 654 987 987:654:321:123:123:123:123:123
Rep text 2 ip_v6
FFF0:0000:8a2e:0370:7334 xx 0000 0db8 2001 2001:0db8:0000:FFF0:0000:8a2e:0370:7334
123:123:123:123:123 xx 321 654 987 987:654:321:123:123:123:123:123