DbFunctions.AddSeconds throws {Error: 42883: operator does not exist: timestamp without time zone < interval}

DbFunctions.AddSeconds throws {Error: 42883: operator does not exist: timestamp without time zone < interval}

Postby CConnes » Wed 19 Nov 2014 14:43

Hi,
I'm facing a problem when using AddSecond with devArt provider & EntityFramework

Table DDL:
CREATE TABLE IF NOT EXISTS TOTO (
TOTOID SERIAL NOT NULL,
ATTRIBUTE_2 TIMESTAMP,
ATTRIBUTE_3 TIMESTAMP WITH TIME ZONE,
CONSTRAINT PK_TOTO PRIMARY KEY (TOTOID)
);

The Linq query used :
var rows = model.toto.Where(t => t.ATTRIBUTE_2 >= localTime && t.ATTRIBUTE_2 < DbFunctions.AddSeconds(localTime, 1));

The sql generated:
SELECT
"Extent1".totoid,
"Extent1".attribute_2,
"Extent1".attribute_3
FROM toto AS "Extent1"
WHERE ("Extent1".attribute_2 >= :p__linq__0) AND ("Extent1".attribute_2 < ((:p__linq__1 + INTERVAL '1 SECONDS')))

-- p__linq__0: '19/11/2014 10:38:08' (Type = DateTime, IsNullable = false)
-- p__linq__1: '19/11/2014 10:38:08' (Type = DateTime, IsNullable = false)

My version is dcpostgresql 7.3.171.0 pro.

If i remove the call to the Addfunction to replace it with the datetime computed, the query goes fine.

Thanks for any help

Cedric Connes
CConnes
 
Posts: 8
Joined: Fri 10 Feb 2012 14:51

Re: DbFunctions.AddSeconds throws {Error: 42883: operator does not exist: timestamp without time zone < interval}

Postby Shalex » Fri 21 Nov 2014 16:51

Thank you for your report. We have reproduced the issue and are investigating it.
Shalex
Devart Team
 
Posts: 7659
Joined: Thu 14 Aug 2008 12:44

Re: DbFunctions.AddSeconds throws {Error: 42883: operator does not exist: timestamp without time zone < interval}

Postby Shalex » Thu 11 Dec 2014 16:40

The bug is fixed in the current (7.3.303) build of dotConnect for PostgreSQL.
Shalex
Devart Team
 
Posts: 7659
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL