Foreign Data Wrapper for filesystem

Started by Leonardo M. Raméabout 9 years ago4 messagesgeneral
Jump to latest
#1Leonardo M. Ramé
l.rame@griensu.com

Hi, I'm looking for a FDW that allows listing a directory as a database
table allowing me to check if file exists, does anyonke know if such FDW
exists?.

Regards,
--
Leonardo M. Ram�
Medical IT - Griensu S.A.
Av. Col�n 636 - Piso 8 Of. A
X5000EPT -- C�rdoba
Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19
Cel.: +54 9 (011) 40871877

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Leonardo M. Ramé (#1)
Re: Foreign Data Wrapper for filesystem

"=?UTF-8?Q?Leonardo_M._Ram=c3=a9?=" <l.rame@griensu.com> writes:

Hi, I'm looking for a FDW that allows listing a directory as a database
table allowing me to check if file exists, does anyonke know if such FDW
exists?.

Why not use pg_ls_dir()? An FDW would be mighty awkward to use for this
purpose, even if one existed.

regards, tom lane

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

#3John McKown
john.archie.mckown@gmail.com
In reply to: Tom Lane (#2)
Re: Foreign Data Wrapper for filesystem

On Wed, Feb 15, 2017 at 10:20 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

"=?UTF-8?Q?Leonardo_M._Ram=c3=a9?=" <l.rame@griensu.com> writes:

Hi, I'm looking for a FDW that allows listing a directory as a database
table allowing me to check if file exists, does anyonke know if such FDW
exists?.

Why not use pg_ls_dir()? An FDW would be mighty awkward to use for this
purpose, even if one existed.

​It cannot be used for an arbitrary directory:
" Only files within the database cluster directory and the log_directory can
be accessed. "​
​ref: https://www.postgresql.org/docs/current/static/functions-admin.html​

regards, tom lane

​Personally, I don't know what use such a function would be. It would be
executed on the _SERVER_, not the client. And that is probably why the
pg_ls_dir() is restricted. If it weren't it could be a security (or
privacy) violation.​

--
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

#4Leonardo M. Ramé
l.rame@griensu.com
In reply to: John McKown (#3)
Re: Foreign Data Wrapper for filesystem

El 15/02/17 a las 13:27, John McKown escribió:

On Wed, Feb 15, 2017 at 10:20 AM, Tom Lane <tgl@sss.pgh.pa.us
<mailto:tgl@sss.pgh.pa.us>>wrote:

"=?UTF-8?Q?Leonardo_M._Ram=c3=a9?=" <l.rame@griensu.com
<mailto:l.rame@griensu.com>> writes:

Hi, I'm looking for a FDW that allows listing a directory as a

database

table allowing me to check if file exists, does anyonke know if

such FDW

exists?.

Why not use pg_ls_dir()? An FDW would be mighty awkward to use
for this
purpose, even if one existed.

​It cannot be used for an arbitrary directory:
" Only files within the database cluster directory and the
log_directory can be accessed. "​
​ref: https://www.postgresql.org/docs/current/static/functions-admin.html​

regards, tom lane

​Personally, I don't know what use such a function would be. It would
be executed on the _SERVER_, not the client. And that is probably why
the pg_ls_dir() is restricted. If it weren't it could be a security
(or privacy) violation.​

--
"Irrigation of the land with seawater desalinated by fusion power is
ancient. It's called 'rain'." -- Michael McClary, in alt.fusion

Maranatha! <><
John McKown

Well, I need to check the existence of a file from a query/procedure.
After posting I remembered I could do this with plperlu, I'm installing
it right now.

Regards,
--
Leonardo M. Ramé
Medical IT - Griensu S.A.
Av. Colón 636 - Piso 8 Of. A
X5000EPT -- Córdoba
Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19
Cel.: +54 9 (011) 40871877