Re: Making psql error out on output failures

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "David Zhang" <david(dot)zhang(at)highgo(dot)ca>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Making psql error out on output failures
Date: 2020-01-29 09:51:27
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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:
Twitter: @DanielVerite

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message 2020-01-29 09:58:57 Re: Append with naive multiplexing of FDWs
Previous Message Mark Charsley 2020-01-29 09:41:02 Data race in interfaces/libpq/fe-exec.c