Re: psql -f doesn't complain about directories - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: psql -f doesn't complain about directories
Date
Msg-id 20071115024918.GX19014@alvh.no-ip.org
Whole thread Raw
In response to Re: psql -f doesn't complain about directories  (David Fetter <david@fetter.org>)
List pgsql-hackers
David Fetter wrote:
> On Wed, Nov 14, 2007 at 05:15:20PM -0300, Alvaro Herrera wrote:
> > 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?)
> 
> Yes, I have seen people use just this technique.

Interesting.  Why not just use a standard shell pipe from the command
writing into the named pipe, instead of piping through it?

-- 
Alvaro Herrera                         http://www.flickr.com/photos/alvherre/
"Having your biases confirmed independently is how scientific progress is
made, and hence made our great society what it is today" (Mary Gardiner)


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: psql -f doesn't complain about directories
Next
From: Josh Berkus
Date:
Subject: Re: Spinlock backoff algorithm