pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedzero (o) return code on failure of pg_dump
3+ messages / 2 participants
[nested] [flat]
* zero (o) return code on failure of pg_dump
@ 2003-07-01 14:33 Derek Main <djm@ct.ucs.co.za>
2003-07-01 19:29 ` Re: zero (o) return code on failure of pg_dump Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Derek Main @ 2003-07-01 14:33 UTC (permalink / raw)
To: pgsql-admin
I run a pg-dump in one of my scripts and want to send an e-mail on
failure (i.e. non-zero return code). This particular dump ran out of
disk space and failed. However, the return code is zero! Whether the
pg_dump succeeds or fails, zero is always returned. What is the best way
to check for the successful completion of the pg_dump?
I am running PostgreSQL 7.3 and Redhat Linux 6.2.
Thanks.
Regards,
Derek Main.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: zero (o) return code on failure of pg_dump
2003-07-01 14:33 zero (o) return code on failure of pg_dump Derek Main <djm@ct.ucs.co.za>
@ 2003-07-01 19:29 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-07-03 10:05 ` Re: zero (o) return code on failure of pg_dump Derek Main <djm@ct.ucs.co.za>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2003-07-01 19:29 UTC (permalink / raw)
To: Derek Main <djm@ct.ucs.co.za>; +Cc: pgsql-admin
Derek Main <djm@ct.ucs.co.za> writes:
> I run a pg-dump in one of my scripts and want to send an e-mail on
> failure (i.e. non-zero return code). This particular dump ran out of
> disk space and failed. However, the return code is zero!
That seems like a bug. Looking at current sources, it seems that
pg_dump will always exit(1) if it detects a failure --- did it not
notice the failure?
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: zero (o) return code on failure of pg_dump
2003-07-01 14:33 zero (o) return code on failure of pg_dump Derek Main <djm@ct.ucs.co.za>
2003-07-01 19:29 ` Re: zero (o) return code on failure of pg_dump Tom Lane <tgl@sss.pgh.pa.us>
@ 2003-07-03 10:05 ` Derek Main <djm@ct.ucs.co.za>
0 siblings, 0 replies; 3+ messages in thread
From: Derek Main @ 2003-07-03 10:05 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin
Tom - thanks for explaining the space issue. I think I have that now and
yes, we do need more space. However, you seem to be misunderstanding my
issue with the return codes. Whether I run this job as postgres or as
root (with the 'su' command), the job fails with the message :
pg_dump: [tar archiver] could not write to tar member (wrote
158, attempted 285)
With the 'su', zero is returned and with postgres running the job, one
is returned. How can this be? Is this perhaps an su issue and not a
pg_dump issue?
Tom Lane wrote:
>Derek Main <djm@ct.ucs.co.za> writes:
>
>>[ pg_dump works as root, fails as postgres ]
>>
>
>>I have since found that this is not caused by a space problem since the
>>last time I ran the command, only 90% of the disk was used when it
>>crashed.
>>
>
>I think you've forgotten a standard Unix behavior: root is allowed to
>use up every last block of disk space, but ordinary unprivileged users
>aren't. Ordinary processes will typically start getting "out of disk
>space" errors at either 90% or 95% full, depending on what your minfree
>setting is for the particular filesystem.
>
>Reducing minfree to zero is *not* a good idea, because filesystem
>performance goes to hell in a handbasket when you are down to very
>small amounts of free space. It's time to buy a bigger disk, or do
>some housekeeping to free up space.
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-07-03 10:05 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-01 14:33 zero (o) return code on failure of pg_dump Derek Main <djm@ct.ucs.co.za>
2003-07-01 19:29 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-07-03 10:05 ` Derek Main <djm@ct.ucs.co.za>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox