summaryrefslogtreecommitdiff
path: root/contrib/ltree/crc32.c
diff options
context:
space:
mode:
authorTom Lane2020-04-01 21:31:29 +0000
committerTom Lane2020-04-01 21:31:29 +0000
commit949a9f043eb70a4986041b47513579f9a13d6a33 (patch)
tree5870f8152a71ed8701a552d9bb22e78750afcaad /contrib/ltree/crc32.c
parent501b0187998c24d4a950459d9bf5e67f9f3e4a25 (diff)
Add support for binary I/O of ltree, lquery, and ltxtquery types.
Not much to say here --- does what it says on the tin. The "binary" representation in each case is really just the same as the text format, though we prefix a version-number byte in case anyone ever feels motivated to change that. Thus, there's not any expectation of improved speed or reduced space; the point here is just to allow clients to use binary format for all columns of a query result or COPY data. This makes use of the recently added ALTER TYPE support to add binary I/O functions to an existing data type. As in commit a80818605, we can piggy-back on there already being a new-for-v13 version of the ltree extension, so we don't need a new update script file. Nino Floris, reviewed by Alexander Korotkov and myself Discussion: https://postgr.es/m/CANmj9Vxx50jOo1L7iSRxd142NyTz6Bdcgg7u9P3Z8o0=HGkYyQ@mail.gmail.com
Diffstat (limited to 'contrib/ltree/crc32.c')
-rw-r--r--contrib/ltree/crc32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/ltree/crc32.c b/contrib/ltree/crc32.c
index 0c3e45923b2..8fed3346e8a 100644
--- a/contrib/ltree/crc32.c
+++ b/contrib/ltree/crc32.c
@@ -20,10 +20,10 @@
#include "utils/pg_crc.h"
unsigned int
-ltree_crc32_sz(char *buf, int size)
+ltree_crc32_sz(const char *buf, int size)
{
pg_crc32 crc;
- char *p = buf;
+ const char *p = buf;
INIT_TRADITIONAL_CRC32(crc);
while (size > 0)