0

I've got a working pg_hba.conf file in the default location that lists specific users and address (Windows PG14).

The documentation states that I can also list users and address by creating a file which is prefixed by an @ in pg_hba.conf

Multiple user names can be supplied by separating them with commas. A separate file containing user names can be specified by preceding the file name with @.

But any attempt I've made to do this results in a FATAL: could not load pg_hba.conf error

So this type of line works fine

host        all     user1,user2,user3       10.34.0.0/16        scram-sha-256

But this sort of line results in the FATAL: could not load pg_hba.conf error

host        all     @myusers        10.34.0.0/16        scram-sha-256

The "myusers" file with no filename extension is in the same directory as the pg_hba.conf and created by the same Windows user that is editing the conf file. The myuser file simply contains the following lines per the documentation

Files included by @ constructs are read as lists of names, which can be separated by either whitespace or commas.

user1,user2,user3

As the @ construct bit seems a bit ambiguous I've also tried a single line with spaces between users as well as one user per line, ie

user1
user2
user3

What am I doing wrong here? I've had a reasonable effort to hunt around for examples and documentation but I didn't find anything other than the official documentation which is a bit limited. Is the @filename syntax even valid for pg_hba.conf?

1
  • Please give the complete and exact error message, as formatted text. It will be multiple lines. If you need to censor it for sensitive data, make it clear what part was censored.
    – jjanes
    Commented Aug 11, 2023 at 21:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.