COPY extended?

Поиск
Список
Период
Сортировка
От Alfred Perlstein
Тема COPY extended?
Дата
Msg-id 20000724161634.I13979@fw.wintelcom.net
обсуждение исходный текст
Список pgsql-hackers
With the TEXT form of COPY IN, is it possible to specify which columns?

If not, it would be nice to be able to do this:

COPY tablename (row1, row2, row3) from stdin;

About binary copy...

Maybe this is new, but the COPY IN with 'binary format', would this
work via a libpq connection?

About 'binary' COPY, even though the specifcation is there, I'm
not sure it's very clear:

At the start of the file     uint32 number of tuples                       For each tuple     uint32 total length of
tupledata     uint32 oid (if specified)     uint32 number of null attributes[uint32,...,uint32] attribute numbers of
attributes,counting from 0       - <tuple data>
 

I'm not sure I understand this, what is "number of null attributes"?

does "attribute numbers of attributes, counting from 0" mean that
if I have a table like so:

create table foo ( f1 int4, f2 int4 );

that 'f1' would be 0 and 'f2' would be 1?  (The example seems to suggest
that 'f1' is 1 and 'f2' is 2)

How does one delimit the tuple data?  It says: "Notice how the char(2) field is padded with nulls to four bytes and the
textfield is preceded by its length"
 

I'm not sure what that means, does it mean, that if
sizeof(feild) < sizeof(uint32) then?  which way do I pad?  Are there
any macros in libpq to assist in making this compact data?

thanks,
-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Don Baccus
Дата:
Сообщение: RE: INET/CIDR types
Следующее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: Vacuum only with 20% old tuples