pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_upgrade errno
4+ messages / 3 participants
[nested] [flat]

* pg_upgrade errno
@ 2022-07-31 13:41 Justin Pryzby <pryzby@telsasoft.com>
  2022-07-31 23:39 ` Re: pg_upgrade errno Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 4+ messages in thread

From: Justin Pryzby @ 2022-07-31 13:41 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-hackers

Since 3a769d823 (pg_upgrade: Allow use of file cloning)
file.c has had:

-       if (ioctl(dest_fd, FICLONE, src_fd) < 0)
-       {
-               unlink(dst);
-               pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
-                                schemaName, relName, src, dst, strerror(errno));
-       }

But errno should be saved before strerror/%m.

-- 
Justin





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_upgrade errno
  2022-07-31 13:41 pg_upgrade errno Justin Pryzby <pryzby@telsasoft.com>
@ 2022-07-31 23:39 ` Michael Paquier <michael@paquier.xyz>
  2022-07-31 23:43   ` Re: pg_upgrade errno Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Paquier @ 2022-07-31 23:39 UTC (permalink / raw)
  To: Justin Pryzby <pryzby@telsasoft.com>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-hackers

On Sun, Jul 31, 2022 at 08:41:35AM -0500, Justin Pryzby wrote:
> Since 3a769d823 (pg_upgrade: Allow use of file cloning)
> file.c has had:
> 
> -       if (ioctl(dest_fd, FICLONE, src_fd) < 0)
> -       {
> -               unlink(dst);
> -               pg_fatal("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s",
> -                                schemaName, relName, src, dst, strerror(errno));
> -       }
> 
> But errno should be saved before strerror/%m.

Good catch, Justin.  Will fix on HEAD.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../YucSnskQnxLc4ANF@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_upgrade errno
  2022-07-31 13:41 pg_upgrade errno Justin Pryzby <pryzby@telsasoft.com>
  2022-07-31 23:39 ` Re: pg_upgrade errno Michael Paquier <michael@paquier.xyz>
@ 2022-07-31 23:43   ` Tom Lane <tgl@sss.pgh.pa.us>
  2022-08-01 00:19     ` Re: pg_upgrade errno Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2022-07-31 23:43 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Justin Pryzby <pryzby@telsasoft.com>; Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-hackers

Michael Paquier <michael@paquier.xyz> writes:
> On Sun, Jul 31, 2022 at 08:41:35AM -0500, Justin Pryzby wrote:
>> But errno should be saved before strerror/%m.

> Good catch, Justin.  Will fix on HEAD.

It's been wrong a lot longer than that, no?

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_upgrade errno
  2022-07-31 13:41 pg_upgrade errno Justin Pryzby <pryzby@telsasoft.com>
  2022-07-31 23:39 ` Re: pg_upgrade errno Michael Paquier <michael@paquier.xyz>
  2022-07-31 23:43   ` Re: pg_upgrade errno Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-08-01 00:19     ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2022-08-01 00:19 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Justin Pryzby <pryzby@telsasoft.com>; Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-hackers

On Sun, Jul 31, 2022 at 07:43:25PM -0400, Tom Lane wrote:
> It's been wrong a lot longer than that, no?

Since the beginning of times.  But we've never really cared about
fixing such errno behaviors based on their unlikeliness, have we?  I
don't mind doing a backpatch here, though, that's isolated enough.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../Yucb%2FjpcRFFTz2IR@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2022-08-01 00:19 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-31 13:41 pg_upgrade errno Justin Pryzby <pryzby@telsasoft.com>
2022-07-31 23:39 ` Michael Paquier <michael@paquier.xyz>
2022-07-31 23:43   ` Tom Lane <tgl@sss.pgh.pa.us>
2022-08-01 00:19     ` Michael Paquier <michael@paquier.xyz>

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