Re: translating filenames into tablenames? - Mailing list pgsql-general

From Medi Montaseri
Subject Re: translating filenames into tablenames?
Date
Msg-id 3E4AF57B.3080303@intransa.com
Whole thread Raw
In response to Re: translating filenames into tablenames?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
You can also write your own based on

The following that I call ols (oid ls)

----------------------------------- cut
----------------------------------------
#!/bin/bash

DIR=$1

cd $DIR
for file in `ls -S`
do
   psql -qc "select relid,relname from pg_stat_all_tables where
relid=$file" | grep $file
done

----------------------------------- cut again
--------------------------------------

yes, it  could be optimized...

Bruce Momjian wrote:

>I think you want /contrib/oid2name.
>
>---------------------------------------------------------------------------
>
>Ed L. wrote:
>
>
>>Could someone point me to the docs or remind me of the tool that
>>allows me to translate filenames under $PGDATA/base/ into the
>>corresponding DB object name?  I know this is an FAQ, but I didn't
>>see it.
>>
>>Thanks in advance.
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 4: Don't 'kill -9' the postmaster
>>
>>
>>
>
>
>




pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: translating filenames into tablenames?
Next
From: Greg Stark
Date:
Subject: Re: Is there anything equivalent to Oracle9i's list partitioning?