tablespace directories

Started by Bèrto ëd Sèraabout 13 years ago4 messagesgeneral
Jump to latest
#1Bèrto ëd Sèra
berto.d.sera@gmail.com

Hi all,

I have to monitor a number of pg physical files based on writing
access time. All fine, stats does it. I do, however, have a problem in
finding out where the files are. To get a list I'm using

select
oid,
spcname,
pg_tablespace_location(oid)
from pg_tablespace

however, the location is shorter then I would need (it simply records
how tblspcs were created).

My files are at

<creation path>/PG_9.2_201204301/417519

and I am quite struggling to understand how this final
PG_9.2_201204301/417519 part is generated. Is there any way I can dig
it out from the catalog?

Cheers
Bèrto

--
==============================
If Pac-Man had affected us as kids, we'd all be running around in a
darkened room munching pills and listening to repetitive music.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Bèrto ëd Sèra
berto.d.sera@gmail.com
In reply to: Bèrto ëd Sèra (#1)
Re: tablespace directories

Hi again,

<creation path>/PG_9.2_201204301/417519

This should really have been written

<creation path>/PG_9.2_201204301/<dboid>

the mystery is around the version_date (or so it would seem to be) part.

Cheers
Bèrto

--
==============================
If Pac-Man had affected us as kids, we'd all be running around in a
darkened room munching pills and listening to repetitive music.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Bèrto ëd Sèra (#2)
Re: tablespace directories

Bèrto ëd Sèra wrote:

<creation path>/PG_9.2_201204301/<dboid>

the mystery is around the version_date (or so it would seem to be) part.

That's the catalog version.
You can't get it from the catalogs AFAIK, but
the pg_controldata server utility will show
the information.

If you really need, you could wrap the executable
in a PL/PerlU function.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Bèrto ëd Sèra
berto.d.sera@gmail.com
In reply to: Laurenz Albe (#3)
Re: tablespace directories

Hi Laurenz

That's the catalog version.
You can't get it from the catalogs AFAIK, but
the pg_controldata server utility will show
the information.

Thanks! Much appreciated. I'm in a bash script, so it's fine.

Cheers
Bèrto

--
==============================
If Pac-Man had affected us as kids, we'd all be running around in a
darkened room munching pills and listening to repetitive music.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general