Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
Can I connect as a custom user/role to postgresql db?

I created a user/role in postgres db and set default search_path to a specific schema. Now what I am trying to achieve is connect to the database using the new user/role and be able to work on that schema for all queries to database.

CREATE ROLE ltv_dev WITH PASSWORD '<some password>';

So I was hoping if I can connect to the database using a connection string that is for the user/role from a .net core web client using Npgsql.

My previous connection string was.

"NpgsqlConnectionStringOptions": {
        "Server": "server_location",
        "Port": 5432,
        "Database": "db_name",
        "UserId": "original_user_id",
        "Password": "pwd"
      }

I tried changing the UserId from the previous connection string to the new user/role and the password as well.

My new connection string

"NpgsqlConnectionStringOptions": {
        "Server": "server_location",
        "Port": 5432,
        "Database": "db_name",
        "UserId": "ltv_dev",
        "Password": "password_for_the_role"
      }

But it did not work.

Is there any way I can connect to the database using a custom user/role from a .net client using Npgsql or is there another approach to solving this issue? Thanks

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You have created a role without LOGIN privilige, the NOLOGIN option is by default in CREATE ROLE, or you can use CREATE USER:

CREATE USER ltv_dev PASSWORD '<some password>';

you can see it in the documentation

CREATE ROLE

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda