Binary format for array in COPY-command

Started by Nonameover 8 years ago2 messagesdocs
Jump to latest
#1Noname
vladqt@gmail.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.5/static/datatype-bit.html
Description:

Hi,
I could not find description of arrays for 9.6 Postgres:
https://www.postgresql.org/docs/9.6/static/sql-copy.html

Array fields have different format than all other data. They have it's own
header - and i want to know field description.

I added hardcode support of smallint[] into this module:
https://github.com/altaurog/pgcopy
And need full description to create full support of arrays.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: Binary format for array in COPY-command

vladqt@gmail.com writes:

I could not find description of arrays for 9.6 Postgres:
https://www.postgresql.org/docs/9.6/static/sql-copy.html

I do not think it's explicitly documented anyplace (neither is
the binary format for anything else, really). But you can work
it out easily enough by looking at array_send and array_recv:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/adt/arrayfuncs.c;hb=HEAD

regards, tom lane