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
I am trying to create named queries with parameter aggregation, but I get syntax error at or near "$" errors. I tested with the queries from the manual, but they also failed:
user@localhost:db> \ns users_by_age select*from users where id in ($*)
Saved.
Time: 0.001s
user@localhost:db> \n users_by_age 42
syntax error at or near "$"LINE1: select*from users where id in ($*)
You seem to use version 3.3.1. Could you try updating to the latest version (3.5.0)? I cannot reproduce this issue with that latest version:
pgcli -h localhost -U pgcli-dev -W pgcli-dev
Password for pgcli-dev:
Server: PostgreSQL 15.4
Version: 3.5.0
Home: http://pgcli.com
pgcli-dev> create table users (id int)
CREATE TABLE
pgcli-dev> insert into users (id) values (1337);
INSERT 0 1
pgcli-dev> insert into users (id) values (42);
INSERT 0 1
pgcli-dev> insert into users (id) values (1);
INSERT 0 1
pgcli-dev> \ns users_by_age select * from users where id in ($*)
Saved.
pgcli-dev> \n users_by_age 42
> select * from users where id in ($*)
+----+
| id |
|----|
| 42 |
+----+
SELECT 1
(By the way, I opened dbcli/pgcli.com#58 to fix the typo in the users_by_age named query. The name subtly suggests that it should filter on anage column, not the id. ;) That documentation fix is irrelevant to this issue, though.)
Description
I am trying to create named queries with parameter aggregation, but I get
syntax error at or near "$"
errors. I tested with the queries from the manual, but they also failed:Your environment
pip freeze
The text was updated successfully, but these errors were encountered: