Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

326
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda