Re: psql -f doesn't complain about directories

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql -f doesn't complain about directories
Date: 2007-11-14 20:15:20
Message-ID: 20071114201519.GV19014@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Letting psql execute a script file that is really a directory doesn't complain
> at all:
>
> $ psql -f /tmp
>
> Should we do some kind of stat() before opening the file and abort if it's a
> directory?

Actually anything other than a plain file, right? (Do we really want to
be able to psql -f a_pipe?)

--
Alvaro Herrera Developer, http://www.PostgreSQL.org/
Essentially, you're proposing Kevlar shoes as a solution for the problem
that you want to walk around carrying a loaded gun aimed at your foot.
(Tom Lane)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2007-11-14 20:17:10 Re: Fix pg_dump dependency on postgres.h
Previous Message Oleg Bartunov 2007-11-14 19:55:48 Re: a tsearch2 (8.2.4) dictionary that only filters out stopwords