Skip to content

Tag: postgresql

Postgresql : “OR” does’nt work like I want

I’ve got some problem with my request : This request work : This request work : But when I put an “OR” between the both requests, it doesn’t work : I’ve tried to put parentheses, but the request still doesn’t work. Do you have any idea ? Answer Becomes easier to read when y…

Order of cascaded deletes in postgres

I encountered a problem which makes me suspect Postgres deletes rows from dependent tables (ON DELETE CASCADE) only after it already deleted the original row. I have these tables: I created a trigger (before delete) on the function_inclusion table: Let’s say I have 2 functions and a function_inclusion: …

Can SQL with CASE condition use index in PostgreSQL?

When I write a SQL like SELECT * FROM table WHERE table.col && object, I could use the index I built (as it support && operator), but with It seems I can’t use the index? What is the reason of this? Is there any way to solve it? Actually I want to implement a logic like CASE WHEN a&&…