Using Max() with timestamps

Using PGNP with Microsoft .NET

Using Max() with timestamps

Postby paulsk » Thu Apr 16, 2009 6:48 am

[PGNP32-1.2.8.1110]

I have a table 'Messages' containing a column 'Posted' of type timestamp without time zone.

I need to get the newest table entry. The current SQL is
Code: Select all
SELECT Max(m.Posted) AS LastMessage FROM Messages m
which works okay for Oracle and Sqlserver for .NET 2.0 and also Oracle, Sqlserver and Postgres for Java. But it fails with your driver with the following exception when the resultset tries to be read using either rs[0] or rs[("LastMessage")]

System.Data.OleDb.OleDbException - "Accessor validation was deferred and was performed while the method returned data. The binding was invalid for this column or parameter."

The Max() function has been successfully used with Integer type columns, but fails with timestamps. I do not have a workaround for this either.
paulsk
 
Posts: 8
Joined: Wed Apr 15, 2009 4:42 am

Re: Using Max() with timestamps

Postby Moderator » Thu Apr 16, 2009 11:58 pm

This is a known issue.It is result of limitations in expression type evaluation engine in version 1.2.8.

We have fixed it in version 1.3 and considering to migrate some of that code into 1.2.8.
User avatar
Moderator
Site Admin
 
Posts: 279
Joined: Wed Oct 29, 2008 11:27 pm

Re: Using Max() with timestamps

Postby paulsk » Fri Apr 17, 2009 12:39 am

This problem is the only driver problem that I cannot workaround and it either needs to be fixed in 1.2.8 or the 1.3 release needs to be done very soon.
paulsk
 
Posts: 8
Joined: Wed Apr 15, 2009 4:42 am

Re: Using Max() with timestamps

Postby paulsk » Mon Apr 20, 2009 12:24 am

Since the 1.3 release is expected around the middle of summer 2009, when will the 1.2.8 be patched to contain a fix for this?

It is the last problem which is preventing me from releasing my project for final testing.
paulsk
 
Posts: 8
Joined: Wed Apr 15, 2009 4:42 am

Re: Using Max() with timestamps

Postby Moderator » Mon Apr 20, 2009 5:52 pm

We'll try to migrate the fix from 1.3 and send you 1.2.8 trial build in a couple of days.
User avatar
Moderator
Site Admin
 
Posts: 279
Joined: Wed Oct 29, 2008 11:27 pm

Re: Using Max() with timestamps

Postby paulsk » Tue Apr 21, 2009 12:16 am

That would be much appreciated :D
paulsk
 
Posts: 8
Joined: Wed Apr 15, 2009 4:42 am

Re: Using Max() with timestamps

Postby Moderator » Thu Apr 30, 2009 10:11 pm

We have the fix and we are going to publish trial builds by weekend. I'll update this post with the links to the install modules when they are ready.

Update: here are the links to installation modules:
http://www.pgoledb.com/downloads/PGNP32-1.2.8.1120.exe (32-bit)
http://www.pgoledb.com/downloads/PGNP64-1.2.8.1120.exe (64-bit)

Let us know if you will have any questions.
User avatar
Moderator
Site Admin
 
Posts: 279
Joined: Wed Oct 29, 2008 11:27 pm


Return to .NET

Who is online

Users browsing this forum: No registered users and 1 guest