SELECT * FROM pg_stat_activity where datname = 'table_name';
backend_start | 2019-06-27 19:07:26.27754+03
xact_start | 2019-06-27 20:59:20.536273+03
query_start | 2019-06-27 20:59:20.537312+03
state_change | 2019-06-27 20:59:20.537313+03
wait_event_type |
wait_event |
state | active
query | DELETE FROM table_name
SELECT 'table_name'::regclass::oid;
SELECT conname, conrelid::pg_catalog.regclass, pg_catalog.pg_get_constraintdef(c.oid, true) as condef FROM pg_catalog.pg_constraint c WHERE c.confrelid = 'id' AND c.contype = 'f' ORDER BY 1;
SELECT conname, conrelid::pg_catalog.regclass, pg_catalog.pg_get_constraintdef(c.oid, true) as condef FROM pg_catalog.pg_constraint c WHERE c.confrelid = 'table_name' AND c.contype = 'f' ORDER BY 1;
ERROR: invalid input syntax for type oid: "grades"
@Column(name = "user_id")
@Getter
@Setter
private Integer userId;
@Getter
@Setter
private Integer userId;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
@Setter
@Getter
private User user;
Решил так:
select (select count(DISTINCT id_city) from T3 where id_сountry=1 AND id_city IN (1, 2)) = 2;