Solaris - psql returns 0 instead of 1 for file not found.

Поиск
Список
Период
Сортировка
От Clark, Andrew
Тема Solaris - psql returns 0 instead of 1 for file not found.
Дата
Msg-id 74825F195D477C4995425A1313D646B114A923@smbfisyyz01.FNFIS.COM
обсуждение исходный текст
Ответы Re: Solaris - psql returns 0 instead of 1 for file not found.  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Solaris - psql returns 0 instead of 1 for file not found.  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-ports

Hi all,

I've found the when psql is used with the -f flag and the specified file doesn't exist the rc value is 0.

$ uname -a
SunOS bld 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Fire-V440

$ psql -V
psql (PostgreSQL) 8.0.2

$ ls foo
foo: No such file or directory

$ psql -f foo
foo: No such file or directory
 
$ echo $?
0

However, in the man page for psql it says:

EXIT STATUS
     psql returns 0 to the shell if it finished normally, 1 if  a
     fatal  error  of  its  own  (out  of memory, file not found)
     occurs, ...

I'm assuming this is the same with other platforms, but I only use PostgreSQL on Solaris.

Has this been fix in 8.0.3?

Cheers,
Andrew

В списке pgsql-ports по дате отправления:

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: could help me?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Solaris - psql returns 0 instead of 1 for file not found.