public inbox for [email protected]  
help / color / mirror / Atom feed
Issue with configuration parameter "require_auth"
5+ messages / 2 participants
[nested] [flat]

* Issue with configuration parameter "require_auth"
@ 2024-07-17 15:09 Gaisford, Phillip <[email protected]>
  2024-07-17 15:23 ` Re: Issue with configuration parameter "require_auth" Tom Lane <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Gaisford, Phillip @ 2024-07-17 15:09 UTC (permalink / raw)
  To: [email protected] <[email protected]>

I am having trouble using require_auth (https://www.postgresql.org/docs/16/libpq-connect.html#LIBPQ-CONNECT-REQUIRE-AUTH).


Using golang sqlx.Connect on the client side, the connection fails and my Postgresql 16 server logs the following:

2024-07-17 14:42:07.285 UTC [115] FATAL:  unrecognized configuration parameter "require_auth"



What could the issue be?



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Issue with configuration parameter "require_auth"
  2024-07-17 15:09 Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
@ 2024-07-17 15:23 ` Tom Lane <[email protected]>
  2024-07-17 16:17   ` Re: Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2024-07-17 15:23 UTC (permalink / raw)
  To: Gaisford, Phillip <[email protected]>; +Cc: [email protected] <[email protected]>

"Gaisford, Phillip" <[email protected]> writes:
> Using golang sqlx.Connect on the client side, the connection fails and my Postgresql 16 server logs the following:
> 2024-07-17 14:42:07.285 UTC [115] FATAL:  unrecognized configuration parameter "require_auth"

require_auth is a connection parameter, like host or port or dbname.
You seem to be trying to specify it as a server parameter, ie inside
the "options" connection parameter.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Issue with configuration parameter "require_auth"
  2024-07-17 15:09 Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
  2024-07-17 15:23 ` Re: Issue with configuration parameter "require_auth" Tom Lane <[email protected]>
@ 2024-07-17 16:17   ` Gaisford, Phillip <[email protected]>
  2024-07-17 17:11     ` Re: Issue with configuration parameter "require_auth" Tom Lane <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Gaisford, Phillip @ 2024-07-17 16:17 UTC (permalink / raw)
  To: [email protected] <[email protected]>

Interesting…

So what would a connection URI using require_auth properly look like? Here’s what I have been trying:

url: "postgres://postgres:postgres@localhost:5432/aioli?require_auth=password&application_name=aioli-controller&sslmode=disable&sslrootcert=",


From: Tom Lane <[email protected]>
Date: Wednesday, July 17, 2024 at 11:24 AM
To: Gaisford, Phillip <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Issue with configuration parameter "require_auth"
"Gaisford, Phillip" <[email protected]> writes:
> Using golang sqlx.Connect on the client side, the connection fails and my Postgresql 16 server logs the following:
> 2024-07-17 14:42:07.285 UTC [115] FATAL:  unrecognized configuration parameter "require_auth"

require_auth is a connection parameter, like host or port or dbname.
You seem to be trying to specify it as a server parameter, ie inside
the "options" connection parameter.

                        regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Issue with configuration parameter "require_auth"
  2024-07-17 15:09 Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
  2024-07-17 15:23 ` Re: Issue with configuration parameter "require_auth" Tom Lane <[email protected]>
  2024-07-17 16:17   ` Re: Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
@ 2024-07-17 17:11     ` Tom Lane <[email protected]>
  2024-07-17 18:58       ` Re: Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2024-07-17 17:11 UTC (permalink / raw)
  To: Gaisford, Phillip <[email protected]>; +Cc: [email protected] <[email protected]>

"Gaisford, Phillip" <[email protected]> writes:
> So what would a connection URI using require_auth properly look like? Here’s what I have been trying:

> url: "postgres://postgres:postgres@localhost:5432/aioli?require_auth=password&application_name=aioli-controller&sslmode=disable&sslrootcert=",

Hm, that looks right (and behaves as-expected here).

What version of what client-side stack are you using?  For me, libpq 16
and up recognize this parameter, while older versions fail with

psql: error: invalid URI query parameter: "require_auth"

If you're using some other client driver, maybe it doesn't know this
parameter and guesses that it should be passed to the server.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Issue with configuration parameter "require_auth"
  2024-07-17 15:09 Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
  2024-07-17 15:23 ` Re: Issue with configuration parameter "require_auth" Tom Lane <[email protected]>
  2024-07-17 16:17   ` Re: Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
  2024-07-17 17:11     ` Re: Issue with configuration parameter "require_auth" Tom Lane <[email protected]>
@ 2024-07-17 18:58       ` Gaisford, Phillip <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Gaisford, Phillip @ 2024-07-17 18:58 UTC (permalink / raw)
  To: [email protected] <[email protected]>

I think Tom is right.

I am using v5.6 of https://github.com/jackc/pgx

I quick read of the code reveals no awareness of require_auth, so I have filed an issue with the project.

From: Tom Lane <[email protected]>
Date: Wednesday, July 17, 2024 at 1:11 PM
To: Gaisford, Phillip <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Issue with configuration parameter "require_auth"
"Gaisford, Phillip" <[email protected]> writes:
> So what would a connection URI using require_auth properly look like? Here’s what I have been trying:

> url: "postgres://postgres:postgres@localhost:5432/aioli?require_auth=password&application_name=aioli-controller&sslmode=disable&sslrootcert=",

Hm, that looks right (and behaves as-expected here).

What version of what client-side stack are you using?  For me, libpq 16
and up recognize this parameter, while older versions fail with

psql: error: invalid URI query parameter: "require_auth"

If you're using some other client driver, maybe it doesn't know this
parameter and guesses that it should be passed to the server.

                        regards, tom lane


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2024-07-17 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17 15:09 Issue with configuration parameter "require_auth" Gaisford, Phillip <[email protected]>
2024-07-17 15:23 ` Tom Lane <[email protected]>
2024-07-17 16:17   ` Gaisford, Phillip <[email protected]>
2024-07-17 17:11     ` Tom Lane <[email protected]>
2024-07-17 18:58       ` Gaisford, Phillip <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox