Re: Test for file exists? - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Test for file exists?
Date
Msg-id 200409200930.44193.josh@agliodbs.com
Whole thread Raw
In response to Test for file exists?  ("Richard Sydney-Smith" <richard@ibisaustralia.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: T E Schmitz
Date:
Subject: Re: COUNT(*) to find records which have a certain number of
Next
From: Rod Taylor
Date:
Subject: Re: COUNT(*) to find records which have a certain number of