Search code examples
postgresqlpgadmin

how to read files in postgresql data directory


How to read a file in pgsql/data/base/16384 directory in postgresql. these files similar to binary file or dat file. I try to import it in a specific table using pgAdmin, but I got error like this: see the below picture

Also I try to Restore whole database using tar file but i got "no header for toc.dat" when restoring with pgadmin.

Is there any way to read files in data/base/16384 in postgresql?

Thank to All my friend.


Solution

  • try this with pgAdmin:

    select datname from pg_database where oid = 16384;
    --connect to the database from return of above
    select relname from pg_class where relfilenode = 11779;
    --select * from <return of above>