Skip to content

NET8 Npgsql.PostgresException: '42883: function pg_catalog.timezone(unknown, interval) does not exist #2980

@gieniowski

Description

@gieniowski

writing query that contain such condition:

var queryable = _context.SomeTable
	.Where(x => x.Date > DateOnly.FromDateTime(DateTime.UtcNow) && x.Date <= DateOnly.FromDateTime(DateTime.UtcNow.AddDays(14)))

which is translated to this where statement:

FROM some_table AS f
WHERE f.date > CAST(now() AT TIME ZONE 'UTC' AS date) AND f.date <= CAST(now() + INTERVAL '14 days' AT TIME ZONE 'UTC' AS date)

causes this error:
Npgsql.PostgresException: '42883: function pg_catalog.timezone(unknown, interval) does not exist

Not sure if it changes anyting, but I am using EFCore.NamingConventions. I have tried both versions 7.0.2 and 8.0.0-rc.2 and have the same error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions