admin管理员组

文章数量:1334663

I have logged into the PostgreSQL db with psql and want to see the location of config file.

But when I execute SHOW config_file, nothing shows up!

[postgres@bddb06 ~]$ psql -U postgres -d postgres
psql (15.8)
Type "help" for help.

postgres=# 
postgres=# select datname from pg_database;
  datname  
-----------
 postgres
 template1
 template0
(3 rows)

postgres=# select current_database();
 current_database 
------------------
 postgres
(1 row)

postgres=# 
postgres=# select version();
                                                     version                                                     
-----------------------------------------------------------------------------------------------------------------
 PostgreSQL 15.8 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22.0.1), 64-bit
(1 row)

postgres=# SHOW CONFIG_FILE
postgres-# SHOW 'CONFIG_FILE'
postgres-# SHOW 'config_file'
postgres-# 

Can anyone help?

I have logged into the PostgreSQL db with psql and want to see the location of config file.

But when I execute SHOW config_file, nothing shows up!

[postgres@bddb06 ~]$ psql -U postgres -d postgres
psql (15.8)
Type "help" for help.

postgres=# 
postgres=# select datname from pg_database;
  datname  
-----------
 postgres
 template1
 template0
(3 rows)

postgres=# select current_database();
 current_database 
------------------
 postgres
(1 row)

postgres=# 
postgres=# select version();
                                                     version                                                     
-----------------------------------------------------------------------------------------------------------------
 PostgreSQL 15.8 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22.0.1), 64-bit
(1 row)

postgres=# SHOW CONFIG_FILE
postgres-# SHOW 'CONFIG_FILE'
postgres-# SHOW 'config_file'
postgres-# 

Can anyone help?

Share Improve this question asked Nov 20, 2024 at 7:22 sahossainisahossaini 4761 gold badge5 silver badges11 bronze badges 1
  • 1 SHOW commands generally need to end with a semicolon, not just a newline. – jjanes Commented Nov 20, 2024 at 20:57
Add a comment  | 

1 Answer 1

Reset to default -1

Steps to Check:

  • Ensure you have Super User Privileges

  • Try another query:

    SELECT sourcefile FROM pg_file_settings WHERE name = 'config_file';
    

If those two steps are failed, then you can check it manually:

The postgresql.conf file is typically found in the data directory specified during the PostgreSQL installation.

Ref - https://www.postgresql./docs/current/runtime-config-file-locations.html

本文标签: Why is there no rows for 39SHOW configfile39 in PostgreSQL databaseStack Overflow