Thread: Table name from directory

Table name from directory

From
Jason Armstrong
Date:
How do I get the name of a database from a directory on disk (eg
$datadir/base/16494)?

--
Jason Armstrong

Re: Table name from directory

From
Tom Lane
Date:
Jason Armstrong <ja@riverdrums.com> writes:
> How do I get the name of a database from a directory on disk (eg
> $datadir/base/16494)?

That number should match the pg_database.oid column.

            regards, tom lane

Re: Table name from directory

From
Scott Marlowe
Date:
On Fri, Jan 15, 2010 at 7:59 AM, Jason Armstrong <ja@riverdrums.com> wrote:
> How do I get the name of a database from a directory on disk (eg
> $datadir/base/16494)?

There's a handy little utility called oid2name you can use to do it
from the command line.