Peter Eisentraut <[EMAIL PROTECTED]> writes:
> This should do better:
Looks good to me, though I'd suggest updating gets_fromFile's header comment:
- * The result is a malloc'd string.
+ * The result is a malloc'd string, or NULL on EOF or input error.
regards, tom lane
Am Donnerstag, 15. November 2007 schrieb Tom Lane:
> Peter Eisentraut <[EMAIL PROTECTED]> writes:
> > Am Donnerstag, 15. November 2007 schrieb Tom Lane:
> >> This seems too far removed from the scene of the crime
> >
> > Yeah, my zeroth attempt was to place this in gets_fromFile(), but there
> > yo
Peter Eisentraut <[EMAIL PROTECTED]> writes:
> Am Donnerstag, 15. November 2007 schrieb Tom Lane:
>> This seems too far removed from the scene of the crime
> Yeah, my zeroth attempt was to place this in gets_fromFile(), but there you
> don't have any opportunity to report failure to the main loop
Am Donnerstag, 15. November 2007 schrieb Tom Lane:
> This seems too far removed from the scene of the crime
Yeah, my zeroth attempt was to place this in gets_fromFile(), but there you
don't have any opportunity to report failure to the main loop. We'd need to
change the function signature to be
Peter Eisentraut <[EMAIL PROTECTED]> writes:
> Am Mittwoch, 14. November 2007 schrieb Martijn van Oosterhout:
>> It's not the fopen that fails, it's the fgets that returns NULL. We
>> don't subsequently check if that's due to an I/O error or EISDIR or if
>> it's an end-of-file.
> Here is a patch f
Am Mittwoch, 14. November 2007 schrieb Martijn van Oosterhout:
> It's not the fopen that fails, it's the fgets that returns NULL. We
> don't subsequently check if that's due to an I/O error or EISDIR or if
> it's an end-of-file.
Here is a patch for this.
--
Peter Eisentraut
http://developer.post
Martijn van Oosterhout napsal(a):
On Wed, Nov 14, 2007 at 09:33:17PM +0100, Zdenek Kotala wrote:
Sure, why not. To be honest I think that psql shouldn't be ignoring the
EISDIR error the kernel is returning.
But it works when you open directory in read-only mode. See posix
definition:
[EISDIR]
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 openi
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
On Wed, Nov 14, 2007 at 10:25:23PM +0100, Peter Eisentraut wrote:
> Martijn van Oosterhout wrote:
> > To be honest I think that psql shouldn't be ignoring the
> > EISDIR error the kernel is returning.
>
> We use fopen(), which doesn't appear to pass that on.
It's not the fopen that fails, it's th
Martijn van Oosterhout wrote:
> To be honest I think that psql shouldn't be ignoring the
> EISDIR error the kernel is returning.
We use fopen(), which doesn't appear to pass that on.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
---(end of broadcast)--
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, r
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?
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
---(end of broadc
On Wed, Nov 14, 2007 at 09:33:17PM +0100, Zdenek Kotala wrote:
> >Sure, why not. To be honest I think that psql shouldn't be ignoring the
> >EISDIR error the kernel is returning.
>
> But it works when you open directory in read-only mode. See posix
> definition:
>
> [EISDIR]
> The named file
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
Martijn van Oosterhout wrote:
On Wed, Nov 14, 2007 at 05:15:20PM -0300, Alvaro Herrera wrote:
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?)
Sure, why
On Wed, Nov 14, 2007 at 05:15:20PM -0300, Alvaro Herrera wrote:
> > 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?)
Sure, why not. To be hon
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 reall
18 matches
Mail list logo