Re: Question about MemoryContextRegisterResetCallback

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michel Pelletier <pelletier(dot)michel(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question about MemoryContextRegisterResetCallback
Date: 2019-01-14 21:09:41
Message-ID: 23705.1547500181@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michel Pelletier <pelletier(dot)michel(at)gmail(dot)com> writes:
> It mentions "on disk" does this mean the flattened representation must be
> binary compatible with what matrix_send emits? They will likely be the
> same now, so I can see this as a convenience, but is it a requirement?

No, your on-the-wire representation for send/recv can be different from
what you put on-disk. In fact, typically I'd recommend that it *should*
be different to some extent, to insulate COPY BINARY data from internal
representation choices and simplify any client code that might look at
the "binary" format. See for example numeric_send/recv, which don't
just transmit the internal format as-is --- and that was a good thing
because it let us implement various storage optimizations over the years
without breaking COPY BINARY compatibility. It's also a good idea to
try to make the on-the-wire representation independent of server
endianness and alignment rules.

The point of the comment you're looking at is that the "flat" varlena
representation that you have to translate to/from is the same as what
will be on-disk if the datum gets stored someplace.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-01-14 21:21:04 Re: pg_restore restores privileges differently from psql
Previous Message Sherrylyn Branchaw 2019-01-14 20:57:01 Re: pg_restore restores privileges differently from psql