Обсуждение: Binary format for array in COPY-command

Поиск
Список
Период
Сортировка

Binary format for array in COPY-command

От
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.

Re: Binary format for array in COPY-command

От
Tom Lane
Дата:
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