Re: set role command

2025-11-24 Thread pg254kl
Just because you did set role does not mean you lost your superuser privileges, it's correct behavior. If you want to impersonate in a permissions sandbox it's easy: create role usera_sandbox in group usera; \c - usera_sandbox -- regards, Kiriakos Georgiou On 11/24/25 3:15 AM, Calvin Guo - n

Re: Schema design: user account deletion vs. keeping family tree data

2025-11-24 Thread pg254kl
Option B would be fine with me, unless there is good reason to normalize it further.  A query using recursive CTE would be able to find ancestors and descendants neatly and efficiently. I deal with some tables in the billions of rows, and with that hat on, I would use int/bigint identity for t

Re: postgres in swap space

2025-11-17 Thread pg254kl
Putting memory pages to swap is the decision of the linux virtual memory manager not postgres.  If your db machine is swapping, first make sure you have set sensible values for the ram related settings like shared_buffers (25%), effective_cache_size (75%) and work_mem (keep it modest at 4 to 16

Re: Forcing Index usage

2025-11-13 Thread pg254kl
Divide and conquer.  Get rid of the CTE temporarily. create temp table temp_search as ; -- index temp_search *appropriately* analyze temp_search; Use it instead of the CTE. Remove the ORDER BY temporarily. Work on putting the right indices in place to make the above run fast. I assume you h