Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

322
Views
For node-postgres ("pg" library), are session variables safe doing Row-level-security?

I'm making a website with multiple login users and I want to setup row-level-security so that my app can scale. I have a lot of many-many relations with access defined via join-tables. I don't want to have to append each db query with a very long where clause each time and I heard row-level-security was the best approach. I connect to postgres in NodeJS via the 'pg' library and query the db using pool.query('sql string', [params]). The user-id is safely stored and retrieved in a json-web-token, so I'm not worried about that. Questions is, how to I apply the user-id to each db query. Is prepending each query with a "SET my.some_session_variable = user_id" safe? If multiple users are querying the database at once could these multiple set session variables interfere with each other? If row-level-security is not recommended what is the best approach?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!