Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[submodule "libpg_query"]
path = libpg_query
url = https://github.com/pganalyze/libpg_query
# TODO: rollback to original repo after merge https://github.com/pganalyze/libpg_query/pull/368
url = https://github.com/meskill/libpg_query

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's base this on our fork: https://github.com/pgdogdev/libpg_query/

branch = fix-at-time-paranses
7 changes: 7 additions & 0 deletions src/deparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,11 @@ fn test_deparse() {
run_test("DELETE FROM users WHERE id = 1");
run_test("SET my_config TO 1");
run_test("TRUNCATE users");
run_test("SELECT ts AT TIME ZONE tz FROM s");
run_test("SELECT (ts -> 'a') AT TIME ZONE tz FROM s");
run_test("SELECT ts AT TIME ZONE (a -> 'b') FROM s");
run_test("SELECT ts AT TIME ZONE (tz || 'x') FROM s");
run_test(
"SELECT ((summary ->> 'ts')::timestamptz AT TIME ZONE ((summary -> 'stop') ->> 'tz'))::date AS d FROM s",
);
}
Loading