Skip to content

Support PostgreSQL type Timestamptz (TIMESTAMP WITH TIME ZONE) #2417

Closed

Description

@janpio

Problem

Currently Prisma does not handle the PostgreSQL type timestamptz, which leads to it not being introspected appropriately (#552) or queries against fields using it failing (prisma/prisma-client-js#90)

Suggested solution

Prisma should support these types.

Alternatives

None really.

Activity

  1. added
    kind/feature
    topic: client types
    on May 11, 2020
  2. tomhoule commented on May 12, 2020

    @tomhoule
    Contributor

    I just saw this issue pop up in my notifications, and I'm a bit suprised. Are we sure this doesn't work? We have tests that check can introspect (to DateTime), read, write and filter on timestamptz columns in the prisma-engines repo, I just double checked.

  3. janpio commented on May 14, 2020

    @janpio
    ContributorAuthor

    No, this replaced an older feature request that was open and formulated poorly. If you are confident enough we are doing all the right things here, please just close the issue 🚀 Thanks.

  4. self-assigned this
    on May 14, 2020
  5. tomhoule commented on May 14, 2020

    @tomhoule
    Contributor

    I'm quite sure, but I'll check again that it's already supported :)

  6. lights0123 commented on May 17, 2020

    @lights0123

    But as far as I'm aware, migrate doesn't, and will create timestamp columns instead. Should that issue belong in https://github.com/prisma/migrate? Although it would probably require modification of the schema.

  7. pantharshit00 commented on May 18, 2020

    @pantharshit00
    Contributor

    @lights0123 Support for timestampz or any other type for migrate will come in future via #446

    Right now if you start a greenfield (basically from scratch) with migrate, it is a bit opinionated about database type mapping

  8. tomhoule commented on Jul 28, 2020

    @tomhoule
    Contributor

    We do test this type in the query engine test suite, so I think we can consider it supported. This topic will come up again as we work on native types support in the near future.

  9. chrissisura commented on Nov 13, 2020

    @chrissisura

    Hey guys, I getting this error for all my timestamptz with prisma 2.11 after introspecting my postgres database.

    *** WARNING ***

    These fields were commented out because Prisma currently does not support their types.

    • Model "Company", field: "createdAt", original data type: "timestamptz"
  10. giraffesyo commented on Nov 14, 2020

    @giraffesyo

    Hey guys, I getting this error for all my timestamptz with prisma 2.11 after introspecting my postgres database.

    *** WARNING ***

    These fields were commented out because Prisma currently does not support their types.

    • Model "Company", field: "createdAt", original data type: "timestamptz"

    Same problem here, this completely broke my project. Reverting back to 2.10.2 and regenerating fixed it.

  11. devuxer commented on Jul 13, 2021

    @devuxer

    Edit: Ignore this. I was using the wrong database.

    Still broken in @prisma/client 2.26.0.

    I get:

    *** WARNING ***

    These fields are not supported by the Prisma Client, because Prisma currently does not support their types.

    • Model "Info", field: "whenCreated", original data type: "timestamptz"
    • Model "Info", field: "whenUpdated", original data type: "timestamptz"
  12. pantharshit00 commented on Jul 13, 2021

    @pantharshit00
    Contributor

    We do have support for this now: https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#postgresql-6

    Please open a new issue if you encountering any bugs with a minimal reproduction.

  13. devuxer commented on Jul 13, 2021

    @devuxer

    @pantharshit00 , My mistake, I just realized the project I was experimenting with was SQLite not Postgres.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/featuretopic: client typestopic: native database types

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions