X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DCADD329E94 for ; Mon, 20 Sep 2004 17:31:16 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20642-02 for ; Mon, 20 Sep 2004 16:31:11 +0000 (GMT) Received: from davinci.ethosmedia.com (server226.ethosmedia.com [209.128.84.226]) by svr1.postgresql.org (Postfix) with ESMTP id E8628329EA5 for ; Mon, 20 Sep 2004 17:31:11 +0100 (BST) Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 6382150 for pgsql-sql@postgresql.org; Mon, 20 Sep 2004 09:32:28 -0700 From: Josh Berkus Organization: Aglio Database Solutions To: pgsql-sql@postgresql.org Subject: Re: Test for file exists? Date: Mon, 20 Sep 2004 09:30:44 -0700 User-Agent: KMail/1.6.2 References: <002a01c49ec0$4527eb50$630736cb@athlon2000> In-Reply-To: <002a01c49ec0$4527eb50$630736cb@athlon2000> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <200409200930.44193.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/161 X-Sequence-Number: 19007 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