Re: Why did pg_relation_filepath does not give a correct path ? - Mailing list pgsql-general

From Guillaume Lelarge
Subject Re: Why did pg_relation_filepath does not give a correct path ?
Date
Msg-id 1334916326.4142.22.camel@localhost.localdomain
Whole thread Raw
In response to Why did pg_relation_filepath does not give a correct path ?  ("F. BROUARD / SQLpro" <sqlpro@club-internet.fr>)
Responses Re: Why did pg_relation_filepath does not give a correct path ?
List pgsql-general
On Fri, 2012-04-20 at 11:35 +0200, F. BROUARD / SQLpro wrote:
> Hi,
>
> according to the documentation, the function pg_relation_filepath
> "returns the entire file path name (relative to the database cluster's
> data directory PGDATA) of the relation"
>
> When my table are located in the pg_default tablespace, the gievn
> relative path is correct
>
> When my table are located on a specific tablespace, this function
> returns incorrect dats such as :
>
> pg_tblspc/25310/PG_9.1_201105231/16594/25311
>
> only the "PG_9.1_201105231/16594/25311" is correct.
>
> What does the "pg_tblspc/25310" do ???
>
> How can I obtain the correct relative path ?
>

It is the correct relative path. It's relative to $PGDATA. Your
tablespace has the OID 25310. So, you have a symbolic link (or junction
if you are on Windows) named 25310 in your $PGDATA/pg_tblspc directory.
And PostgreSQL will access this table via the symbolic link. It really
uses this path: pg_tblspc/25310/PG_9.1_201105231/16594/25311

There's nothing wrong here.


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


pgsql-general by date:

Previous
From: "F. BROUARD / SQLpro"
Date:
Subject: Why did pg_relation_filepath does not give a correct path ?
Next
From: Martín Marqués
Date:
Subject: Re: Money in numeric field