pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Subject: Re: Test for file exists?
Date: Mon, 20 Sep 2004 09:30:44 -0700
Message-ID: <200409200930.44193.josh@agliodbs.com> (raw)
In-Reply-To: <002a01c49ec0$4527eb50$630736cb@athlon2000>
References: <002a01c49ec0$4527eb50$630736cb@athlon2000>

Richard,

> But only if 'sometable.csv' exists;
>
> If 'sometable.csv' does not exist as an input table I want to continue
> the next command.

Sorry, can't be done in plpgsql.   Regular procedural languages are 
deliberately kept ignorant of the host filesystem in order to prevent 
database users from being able to compromise it.   It's a security thing.

You could easily write a function in an "untrusted" language, like PL/PerlU or 
PL/PythonU, which would test for file existence and return a true/false 
value.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



view thread (2+ messages)

Message-ID: <200409200930.44193.josh@agliodbs.com>
Permalink:  ../200409200930.44193.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200409200930.44193.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com
  Subject: Re: Test for file exists?
  In-Reply-To: <200409200930.44193.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox