From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michel Pelletier <pelletier.michel@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Question about MemoryContextRegisterResetCallback
Date: Mon, 14 Jan 2019 16:09:41 -0500
Message-ID: <23705.1547500181@sss.pgh.pa.us> (raw)
In-Reply-To: <CACxu=v+o-qo6vFf9xV+o-PgaDAzYgyZx2kchPBS2EVmStCu81Q@mail.gmail.com>
References: <CACxu=vKgpqDNySTpQWW6+ev-8-fwwkq90XBqOmx40V-PT0R8mQ@mail.gmail.com>
<9801.1547400642@sss.pgh.pa.us>
<CACxu=v+N5m_z=d-Q-9O1fN2jsk-F7Lf5LxYEL9YcjqdhwVjCxg@mail.gmail.com>
<CACxu=v+o-qo6vFf9xV+o-PgaDAzYgyZx2kchPBS2EVmStCu81Q@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, pelletier.michel@gmail.com
Subject: Re: Question about MemoryContextRegisterResetCallback
In-Reply-To: <23705.1547500181@sss.pgh.pa.us>
References: <CACxu=vKgpqDNySTpQWW6+ev-8-fwwkq90XBqOmx40V-PT0R8mQ@mail.gmail.com> <9801.1547400642@sss.pgh.pa.us> <CACxu=v+N5m_z=d-Q-9O1fN2jsk-F7Lf5LxYEL9YcjqdhwVjCxg@mail.gmail.com> <CACxu=v+o-qo6vFf9xV+o-PgaDAzYgyZx2kchPBS2EVmStCu81Q@mail.gmail.com> <23705.1547500181@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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