Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Feb 6, 2026

DateTime now maps to the PG timestamptz type by default, which represents a UTC timestamp; this aligns with Npgsql and EF Core.

However, now that we have property annotations, I've also added a new WithStoreType() that allows the user to specify a database type explicitly. For now, this is only supported for setting timestamp with time zone (short: timestamp), which is the other PG date/time type, for unspecified timestamps (timezone is unknown or implicitly assumed). This allows users who do want to store non-UTC timestamp to do so.

Closes #10641

@roji roji requested a review from a team as a code owner February 6, 2026 09:28
@moonbox3 moonbox3 added the .NET Issue or Pull requests regarding .NET code label Feb 6, 2026
@github-actions github-actions bot changed the title [MEVD] Map DateTime to timestamptz on PostgreSQL .Net: [MEVD] Map DateTime to timestamptz on PostgreSQL Feb 6, 2026
@roji roji enabled auto-merge February 6, 2026 11:07
Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roji PTAL at my comment. Thanks!

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookz goodz :shipit:

@roji roji added this pull request to the merge queue Feb 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 9, 2026
@roji roji enabled auto-merge February 9, 2026 11:19
@roji roji added this pull request to the merge queue Feb 9, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 9, 2026
DateTime now maps to the PG timestamptz type by default, which
represents a UTC timestamp; this aligns with Npgsql and EF Core.

However, now that we have property annotations, I've also added a new
`WithStoreType()` that allows the user to specify a database type
explicitly. For now, this is only supported for setting `timestamp with
time zone` (short: `timestamp`), which is the other PG date/time type,
for unspecified timestamps (timezone is unknown or implicitly assumed).
This allows users who do want to store non-UTC timestamp to do so.

Closes #10641
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 9, 2026
@roji roji added this pull request to the merge queue Feb 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 9, 2026
@roji roji added this pull request to the merge queue Feb 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.Net MEVD: Reexamine PostgreSQL timestamp mapping

4 participants