From: | Aman Rathi <aman(dot)rathi0904(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | PostgreSQL www <pgsql-www(at)postgresql(dot)org> |
Subject: | Re: Fwd: Psql.exe error logging |
Date: | 2016-02-26 11:29:57 |
Message-ID: | CAOrOm8X4LHm=AibDqWaO0HsgE9V+gsOeOpUVOYQpR8nCWmPtEQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-www |
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
[image: Inline image 1]
2) Ran a command that should fail and exit
[image: Inline image 1]
3) Checked my java log and it shows it ran without errors and continued
with the program.
Right now I have been able to write the error into a log file and then read
it to check if there was any error, but that doesn't seem to be a very
optimized way of handling psql error.
Request you if you could provide me some more tips on how to handle it.
Thanks,
Aman
On Thu, Feb 25, 2016 at 10:03 PM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> On Wed, Feb 24, 2016 at 11:24 PM, Aman Rathi <aman(dot)rathi0904(at)gmail(dot)com>
> wrote:
>
>> Hi,
>>
>> I am running a .sql file using psql.exe command. The command inserts data
>> from a file into a table as is, no checks.
>>
>> Problem I am facing is when even if the command gives me an error, still
>> it completes successfully. I am running this command via java, so am not
>> able to catch the error.
>>
>> It would be of great help if you could rescue me from this situation.
>>
>>
>>
> psql --set=ON_ERROR_STOP=1
>
> http://www.postgresql.org/docs/current/static/app-psql.html
>
> David J.
>
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2016-02-26 14:36:24 | Re: Fwd: Psql.exe error logging |
Previous Message | Amit Kapila | 2016-02-26 04:11:13 | Re: Request for edit rights |