Re: Making psql error out on output failures - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: Making psql error out on output failures
Date
Msg-id 07ae9540-0bcd-4405-9800-70bb4b045d74@manitou-mail.org
Whole thread Raw
In response to Re: Making psql error out on output failures  (David Zhang <david.zhang@highgo.ca>)
Responses Re: Making psql error out on output failures  (David Zhang <david.zhang@highgo.ca>)
List pgsql-hackers
    David Zhang wrote:

> > Are you sure? I don't find that redefinition. Besides
> > print_aligned_text() also calls putc and puts.
> Yes, below is the gdb debug message when psql first time detects the
> error "No space left on device". Test case, "postgres=# select
> repeat('111', 1000000) \g /mnt/ramdisk/file"
> bt
> #0  flushbuffer (target=0x7ffd6a709ad0) at snprintf.c:313

Indeed. For some reason gdb won't let me step into these fprintf()
calls, but you're right they're redefined (through include/port.h):

#define vsnprintf        pg_vsnprintf
#define snprintf        pg_snprintf
#define vsprintf        pg_vsprintf
#define sprintf         pg_sprintf
#define vfprintf        pg_vfprintf
#define fprintf         pg_fprintf
#define vprintf         pg_vprintf
#define printf(...)        pg_printf(__VA_ARGS__)

Anyway, I don't see it leading to an actionable way to reliably keep
errno, as discussed upthread.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite



pgsql-hackers by date:

Previous
From: Mark Charsley
Date:
Subject: Data race in interfaces/libpq/fe-exec.c
Next
From: "movead.li@highgo.ca"
Date:
Subject: Re: Append with naive multiplexing of FDWs