Skip site navigation (1) Skip section navigation (2)

COPY <table> FROM STDIN BINARY

From: Владимир Баранов <baranoff(at)inbox(dot)ru>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: COPY <table> FROM STDIN BINARY
Date: 2007-08-17 11:38:40
Message-ID: E1IM0A4-000BYC-00.baranoff-inbox-ru@f31.mail.ru (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hi,

I have troubles with bulk insert of binary data via COPY command.

I use JDBC 3.0 driver patched by Kalle Hallivuori (http://kato.iki.fi/)
My table is:

create table bulk_data (
    id integer, ts timestamp, ...
);

which I try to populate from Java app using COPY command:

copy bulk_data from stdin binary;

All integer, varchar and bytea values are copied correctly. But when I put into stream System.currentTimeMillis() as the timestamp value, that value is interpreted by PostgreSQL in a manner I could not understand; as the result I get wrong timestamp value in the table.

My question is: what input binary format of a timestamp value should I use?

Thanks a lot for any suggestions,

Vlad


Responses

pgsql-jdbc by date

Next:From: Vance MaverickDate: 2007-08-19 06:09:30
Subject: fyi: reading large BYTEA
Previous:From: Marek LewczukDate: 2007-08-17 08:04:49
Subject: AbstractJdbc2Array rewritten code

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group