You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PostgreSQL money values are not displayed when a query contains variables #983
Looking at this in a little more details, the issue is similar to #721 (comment)
Postgres returns
textual money representations for static queries (so we can display "$1.23"),
and binary values for parametrized queries (so it transmits only the number 123, without the decimal point and the currency)
so the previous behavior will be reintroduced, making your dashboard work again as long as you keep all your queries fully static. But I'd still recommend manually casting to text on the database side to ensure consistent results, even if you later introduce parameters to your queries:
changed the title [-]PostgreSQL money values show as 0.0[/-][+]PostgreSQL money values are not displayed when a query contains variables[/+]on Aug 3, 2025
$ cat tests/end-to-end/fixtures/repro_983/index.sql
SELECT 'big_number' AS component;
SELECT 1.23::money AS value, 'Static' AS title;
SELECT 1.23::money AS value, 'With a variable' AS title, $unused AS description;
$ cat tests/end-to-end/fixtures/repro_983/test.ts
import { expect, test } from "../../fixture.ts";
test("money values show with and without a variable in the query", async ({ page }) => {
await expect(page.locator(".card")).toHaveCount(2);
await expect(page.locator(".card").nth(0)).toContainText("$1.23");
await expect(page.locator(".card").nth(1)).toContainText("$1.23");
});
repro_983
postgres
v0.33.0
✘ failed
v0.47.0
✘ failed
tree
✘ failed
On commit 616df27: nix run .#reproduce -- repro_983 postgres v0.33.0 v0.47.0 tree
Activity
lovasoa commentedon Aug 3, 2025
Hi! Thanks for the quick report. This will be fixed in v0.36.1
lovasoa commentedon Aug 3, 2025
Hi @rhysparry !
Looking at this in a little more details, the issue is similar to #721 (comment)
Postgres returns
so the previous behavior will be reintroduced, making your dashboard work again as long as you keep all your queries fully static. But I'd still recommend manually casting to text on the database side to ensure consistent results, even if you later introduce parameters to your queries:
I'll keep this issue opened.
Add test for Postgres prepared statement types
lovasoa commentedon Aug 3, 2025
Reopening with a new title to reflect how the bug occurs even in 0.36.1 when queries contain parameters
[-]PostgreSQL money values show as 0.0[/-][+]PostgreSQL money values are not displayed when a query contains variables[/+]Fix: PostgreSQL money values show as 0.0
81reap commentedon Oct 29, 2026
I think this is still an issue
Reproduction
On commit 616df27:
nix run .#reproduce -- repro_983 postgres v0.33.0 v0.47.0 tree81reap commentedon Oct 29, 2026
This is actually an intentional design by upstream maintainers transact-rs/sqlx#1206
but given #1056 it may be better to migrate back onto
sqlxfirst