Re: Fwd: Psql.exe error logging

Поиск
Список
Период
Сортировка
От Aman Rathi
Тема Re: Fwd: Psql.exe error logging
Дата
Msg-id CAOrOm8UxXEQo6YS1q7+-EEVzU9eteTocuf=SR26_Q5Q3YD-vfg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fwd: Psql.exe error logging  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-www
Hi David,

1) I thought that --set command is meant at DB level for all the commands being run. So ran it first. Not sure how to use it within the command.

2) -c option: I was doing something but forgot to remove it and didn't notice that it is still there. Now, if I run it with -c option, then also I am facing the same issue.

3) I realize that the psql.log is different from java log. Reason for creating this log is to read the error message from the file since command exists successfully and not with some errors. %errorlevel% is 0 even if the command fails, therefore my java does not stop. So i use this log file to read if there is any error record else continue.

Now, I am facing one more issue: The creation of the log file command sometimes creates a log file and sometimes doesn't ( through java). Wanted to check if there is something I should keep in mind for this.? Command I am running is:
"<path_to_exe>psql.exe" -U <value>-w -h <value>-d <value> -a -f "<path to .sql file>copy_s_m_asset_391.sql" 2> ",log_file_path>psql.log"

Thanks a lot for you help on this. Really appreciate it.

Aman

On Fri, Feb 26, 2016 at 9:29 PM, Melvin Davidson <melvin6925@gmail.com> wrote:


On Fri, Feb 26, 2016 at 10:21 AM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Fri, Feb 26, 2016 at 7:36 AM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Fri, Feb 26, 2016 at 4:29 AM, Aman Rathi <aman.rathi0904@gmail.com> wrote:
Hi David,

Thanks for the reply, but it still doesn't seem to run.

I followed the following steps:
1) updated the on_error_stop value to 1

Inline image 1

2) Ran a command that should fail and exit

Inline image 1


​Any particular reason you didn't just add the --set option from #1 to the psql command in #2?



​As an aside, the portion of the command "psql -c -a -f <file>" is wrong (though apparently not broken...).  You specify, via "c", that you are going to provide a single command for psql to execute but then fail to provide any such command and instead change you mind and tell it your are going to provide a script file, via "f", instead.

David J.​

>3) Checked my java log and it shows it ran without errors and continued with the program.

Do you realize that all psql errors will go to the postgresql log file, not java log?

--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.


Вложения

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Fwd: Psql.exe error logging
Следующее
От: Oleg Bartunov
Дата:
Сообщение: what's happens with pgsql-questions ?