RE: JDBC driver writes binary data ONLY as Large Obj ect
От | Peter Mount |
---|---|
Тема | RE: JDBC driver writes binary data ONLY as Large Obj ect |
Дата | |
Msg-id | 1B3D5E532D18D311861A00600865478CF1B1CD@exchange1.nt.maidstone.gov.uk обсуждение исходный текст |
Список | pgsql-interfaces |
It is inefficient mainly because each LO is (under the current backend implementation) stored as a table/index pair, so if you have loads of LO's under 16K (IIRC it's 1 page for the table, 1 for the index), then you would be wasting a lot of disk space. The new Toast stuff may become useful for this as an alternative. Now as to your error, the parse error is being thrown by the backend (the driver currently does no parsing other than replacing ?'s from the PreparedStatement), so you could try turning on debugging [ DriveManager.setLogStream(System.out); ] and see what the exact query being sent is. Peter -- Peter Mount Enterprise Support Maidstone Borough Council Any views stated are my own, and not those of Maidstone Borough Council -----Original Message----- From: Bill [mailto:bouma@cplane.com] Sent: Thursday, August 03, 2000 8:46 PM To: Peter Mount Cc: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] JDBC driver writes binary data ONLY as Large Object Peter Mount wrote: > Hmmm, I see your point. There must be some way of encoding the string so > that the data is stored correctly. I know certain control characters can be > stored (cr/lf's etc) as I have a PHP script that does it here. > > Is it the new String(bytes[]) bit that barfs, or is it that the data is > mungled when it's re-read from the table? ------------------------------------------- java.sql.SQLException: ERROR: parser: parse error at or near "" at org.postgresql.Connection.ExecSQL(Connection.java, Compiled Code) at org.postgresql.jdbc2.Statement.execute(Statement.java,Compiled Code) at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73) at org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java: 126) ------------------------------------------- Perhaps we can look at the ResultSet.getBytes() and just do the inverse of that? Though I haven't tested if getBytes() is doing the right thing yet, either. In the end I need to be able to store/retrieve the data through both JDBC and ODBC interface. This is working now if I store all binary data as Large Objects. But most of my blobs of binary are only 200-2000 bytes long. I assume it is much less efficient to store such small blobs as LOs? That is, assuming the driver code is written well. So that may not be true with the current JDBC driver given that it would first have to convert the binary blob into a String. 8^( Bill
В списке pgsql-interfaces по дате отправления: