logo       

Re: COPY support in pgsql-jdbc driver: msg#00235

db.postgresql.jdbc

Subject: Re: COPY support in pgsql-jdbc driver

Michael,

I is great to hear that you plan to continue working on this. I look forward to your contribution. I have some additional comments below.


Michael Adler wrote:

Thanks for your response Barry. I've been working on this as time allows.
I am determined to get it eventually.


6) Some debugging output would probably be usefull as well, (see current
sources and the isDebug method and how it is used).


I can't find that method anywhere in the current CVS source. Can you help
me out?

OK, I wasn't very explicit in my response. Here is an example:

if (Driver.logDebug) Driver.debug("your debug message here");

It is a static variable named logDebug and not a method named isDebug(). Debug output can be enabled by adding ?loglevel=2 to the jdbc URL(eg. jdbc:postgresql://localhost:5432/pg?loglevel=2) (or you can use loglevel=1 but that only prints out Info messages of which there currently is only one - the driver version). This information hasn't yet made it into the documentation, but it will before 7.3 is released.

7) The testcase should be done using junit and added to the tests under
org/postgresql/test


I'd like to get this done immediately, but I'm having some trouble with
the tests.

test:
[junit] ..............F......................F.....
[junit] ............
[junit] Time: 4.897
[junit] There were 2 failures:
[junit] 1)
testCapabilities(org.postgresql.test.jdbc2.DatabaseMetaDataTest)junit.framework.AssertionFailedError
[junit] at
org.postgresql.test.jdbc2.DatabaseMetaDataTest.testCapabilities(DatabaseMetaDataTest.java:104)
[junit] 2)
testSetTimestamp(org.postgresql.test.jdbc2.TimestampTest)junit.framework.AssertionFailedError
[junit] at
org.postgresql.test.jdbc2.TimestampTest.timestampTest(TimestampTest.java:120)
[junit] at
org.postgresql.test.jdbc2.TimestampTest.testSetTimestamp(TimestampTest.java:92)

[junit] FAILURES!!!
[junit] Tests run: 53, Failures: 2, Errors: 0


DatabaseMetaDataTest.java:104
assertTrue(!dbmd.supportsANSI92EntryLevelSQL());

TimestampTest.java:120
assertTrue(rs.next());
t = rs.getTimestamp(1);
assertNotNull(t);
assertTrue(t.equals(getTimestamp(1950, 2, 7, 15, 0, 0, 0)));


I am not really sure about these test failures.

Reading one byte at a time from the stream will be slow, that is why it
would be better to read into a buffer.


Are you suggesting that I create a BufferedInputStream inside the method? I was
planning on optimizing after the code and tests had become reliable enough to
take benchmarks.

There are multiple ways this could be done. I don't mean to suggest any one is prefered at this point, but I believe this should be done. Doing it later in the process seems very reasonable.

thanks,
--Barry




---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise