drizzle-team / drizzle-team/drizzle-orm

[BUG]: node-postgres: db.execute() bypasses configured PostgreSQL type parsers for TIMESTAMPTZ

Open
#6,290 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Report hasn't been filed before.

- [x] I have verified that the bug I'm about to report hasn't been filed before.

### What version of `drizzle-orm` are you using?

0.45.2

### What version of `drizzle-kit` are you using?

0.31.10

### Other packages

_No response_

### Describe the Bug

## Summary

With Drizzle ORM `0.45.2` using the `node-postgres` driver, `db.execute()` overrides the PostgreSQL driver's configured type parser for `TIMESTAMPTZ` (OID `1184`) and returns the value as a string.

This produces inconsistent runtime types between:

- native `node-postgres` queries → `Date`
- Drizzle ORM typed queries → `Date`
- Drizzle `db.execute()` → `string`

## Environment

- Drizzle ORM: `0.45.2`
- Driver: `node-postgres` (`pg`)
- Database: PostgreSQL
- Column type: `timestamptz`
- Drizzle column mode: `date`

Schema:

```ts
export const ts = () =>
timestamp({
withTimezone: true,
precision: 3,
mode: 'date',
});

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the mismatch through Drizzle's db.execute() with the node-postgres driver, PostgreSQL TIMESTAMPTZ, and a configured OID 1184 parser. Compare the result with native node-postgres and Drizzle typed queries; done means db.execute() honors the configured parser and returns the consistent runtime type.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, postgresql, typescript
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.