Page 1 of 1

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

Posted: Wed 19 Nov 2014 14:43
by CConnes
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

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

Posted: Fri 21 Nov 2014 16:51
by Shalex
Thank you for your report. We have reproduced the issue and are investigating it.

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

Posted: Thu 11 Dec 2014 16:40
by Shalex
The bug is fixed in the current (7.3.303) build of dotConnect for PostgreSQL.