From: | Simon Connah <simon(dot)n(dot)connah(at)protonmail(dot)com> |
---|---|
To: | depesz(at)depesz(dot)com |
Cc: | "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Application trying to use wrong user when logging into the database |
Date: | 2021-03-29 14:28:34 |
Message-ID: | NyaDa65fVh5N7Mq3dOkpAnxNr6KUjo4K7x_9lAvglvpPWNig3doYYb1QCPm3kLTNL_xWEK3ax7igWD16NaZSfOIZrLrCI4nwH__AHtLTiYU=@protonmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, March 29th, 2021 at 10:47, hubert depesz lubaczewski <depesz(at)depesz(dot)com> wrote:
> On Sun, Mar 28, 2021 at 01:44:59PM +0000, Simon Connah wrote:
>
> > https://github.com/vitaly-t/pg-promise/wiki/Connection-Syntax#configuration-object
> >
> > and have all the right data supplied. But instead of using my
> >
> > applications role which I created in PostgreSQL it is trying to use my
> >
> > Linux user name "simon" and is failing authentication because of it.
> >
> > I'm just confused at the moment. At no point in time have I created
> >
> > a role called "simon" and I have never tried to connect to any of my
> >
> > databases using the role name "simon", so why is it trying to
> >
> > authenticate as "simon"?
>
> Pg will try to connect as db user simon if you don't provide username to
>
> log in as.
>
> For example, if I'm logged in shell as depesz, and will try: psql -d xx,
>
> it will try to login to db xx as user depesz.
>
> To login as user "magic", I have to provide it expliticly: psql -U magic
>
> -d xx.
>
> Please show us your connection code from your app.
>
> Best regards,
>
> depesz
Thank you for your reply. I fixed it. It was a silly mistake on my end where I was not importing the environment variables for database connection information correctly.
Simon.
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Rychlewski | 2021-03-29 15:27:21 | shared buffers |
Previous Message | hubert depesz lubaczewski | 2021-03-29 09:47:59 | Re: Application trying to use wrong user when logging into the database |