This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Running against postgresql v8.4 I have a Blob column that I insert a 256 byte array into and it reads back just fine. Running against the new v9.01 postgres, the 256 insert reads back as a 1027 byte array with different contents. I trying to figure out if it is a LS issue or is this a postgres issue. Have you tested LS against v9 at all? Thanks Peter Shoebridge
|
|
|
We have not yet tested LightSpeed with PostgreSQL 9. To determine if this is a LightSpeed or PostgreSQL issue, probably the best thing to do is to capture the INSERT and SELECT statements that LightSpeed generated and run them directly through the Npgsql driver using ADO.NET. Note that the LightSpeed logger substitutes parameter values for parameter names when logging SQL, so you'll need to sub those back into the INSERT (we have learned from bitter experience that copying a query with literal values and running it through a query tool does not always produce the same results as running the same query through ADO.NET using parameters!). Use LightSpeedContext.VerboseLogging to ensure that the parameter data types match what LightSpeed is sending because that can also affect things. If the ADO.NET code works, could you send us: - A small but complete console or NUnit project containing both ADO.NET and LightSpeed code that demonstrates the problem You can attach a zip file via the Options tab. Thanks! |
|
|
The verbose log unfortunately doesn't contain the actual bytes inserted, just the string System.Byte[] see below. Is there any way to get it to log what is actually inserted?
INSERT INTO Machines ( Id, AccessKey, AssetTag, CreatedOn, DeletedOn, LockVersion, MacAddress, MachineId, SerialNumber, UpdatedOn ) VALUES ( 1419, System.Byte[], 'PJS-VISTA(MT)', '10/29/2010 12:12:25 AM', NULL, 0, 67652447633152, '1EC3C80DFF800-MT', NULL, '10/29/2010 12:12:25 AM' ); |
|
|
To do this you would need to write a custom logger. This is very easy: just implement the ILogger interface. public class MyLogger : ILogger { Then hook up an instance of this instead of TraceLogger or ConsoleLogger. |
|
|
We have set up some test coverage for PostgreSql9 now and this has tripped one of the tests with the same issue you are experiencing. We have reproed this using a simple ADO.NET example and confirmed this is a bug with the driver we rely on - they have actually got a report of this in their forums (see: http://pgfoundry.org/tracker/index.php?func=detail&aid=1010921&group_id=1000140&atid=590) So unfortunately nothing we can directly fix at the moment but we will keep you posted if there is a resolution at the driver end.
Jeremy |
|
|
Here is a patched version of the driver that has the associated fixes which hopefully will save you the time of doing this yourself if you are interested :) You will likely need to add a binding redirect to use this as we compile against a strongly named version of the driver currently.
Jeremy |
|