Re: Question about MemoryContextRegisterResetCallback - Mailing list pgsql-general

From Tom Lane
Subject Re: Question about MemoryContextRegisterResetCallback
Date
Msg-id 23705.1547500181@sss.pgh.pa.us
Whole thread Raw
In response to Re: Question about MemoryContextRegisterResetCallback  (Michel Pelletier <pelletier.michel@gmail.com>)
List pgsql-general
Michel Pelletier <pelletier.michel@gmail.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


pgsql-general by date:

Previous
From: Sherrylyn Branchaw
Date:
Subject: Re: pg_restore restores privileges differently from psql
Next
From: Tom Lane
Date:
Subject: Re: pg_restore restores privileges differently from psql