dbcli / pgcli

Postgres CLI with autocompletion and syntax highlighting
http://pgcli.com
BSD 3-Clause "New" or "Revised" License
12.14k stars 557 forks source link

Result Set Decoration Missing Number of Rows #1320

Closed clairesarraille closed 8 months ago

clairesarraille commented 2 years ago

Description

CURRENT BEHAVIOR: The footer, or result set decoration, at the end of the query output is "SELECT" but does not include the number of rows. Expected behavior for the image below is "SELECT 7" rather than just "SELECT" above "Time: 0.224s"

seg> select * from test_table; +------------------+--------+ | sessionstartdate | sum | |------------------+--------| | 2021-01-15 | 491076 | | 2021-01-19 | 448897 | | 2021-01-17 | 477568 | | 2021-01-20 | 464592 | | 2021-01-21 | 442343 | | 2021-01-18 | 474817 | | 2021-01-16 | 456265 | +------------------+--------+ SELECT Time: 0.152s

EXPECTED BEHAVIOR: "SELECT 7" in footer

NOTE: When I connect to my database using "psql" rather than "pgcli" the number of rows is included in the footer.

seg=# select * from test_table seg-# ; sessionstartdate | sum
------------------+-------- 2021-01-17 | 477568 2021-01-15 | 491076 2021-01-19 | 448897 2021-01-21 | 442343 2021-01-20 | 464592 2021-01-16 | 456265 2021-01-18 | 474817 (7 rows)

Your environment

I'm connecting to Segment db via AWS pgcli -h xx-segment-xxx.xxxxxxxxxxxx.xx-xxxx-x.redshift.amazonaws.com -U [USERNAME] -d seg -p [PORT_NUMBER]

footer missing number of rows output
j-bennet commented 2 years ago

How did you install pgcli? Was it with pip?

clairesarraille commented 2 years ago

No, installed with Homebrew.


From: Irina Truong @.> Sent: Tuesday, March 1, 2022 2:23:03 PM To: dbcli/pgcli @.> Cc: Claire Sarraillé @.>; Author @.> Subject: Re: [dbcli/pgcli] Result Set Decoration Missing Number of Rows (Issue #1320)

How did you install pgcli? Was it with pip?

— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdbcli%2Fpgcli%2Fissues%2F1320%23issuecomment-1055918259&data=04%7C01%7C%7Cb1f76750eed6418d0d4a08d9fbd20db4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637817701859347582%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=fCvj9UPb6fJIUMkhxP%2BQBTZYe%2FCAw9vtoyu4iWlvXOc%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARCBHGL5Q2LDKHKLTPDCGMDU52KEPANCNFSM5PU65NIQ&data=04%7C01%7C%7Cb1f76750eed6418d0d4a08d9fbd20db4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637817701859347582%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=8EjjT9wmMfRCHQxzKXLNPdukg4a1sm6EjsiAhzGkWmM%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7Cb1f76750eed6418d0d4a08d9fbd20db4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637817701859347582%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=NuI%2BTr8Xc0KyFWwVvJS9Vf6LWv2VjNVia3GU%2BaGPaEg%3D&reserved=0 or Androidhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7Cb1f76750eed6418d0d4a08d9fbd20db4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637817701859347582%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=mKHXiQ83hy8vJhQGjDeUWJGKLWlmxnV0Gusd8kcNh7A%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>

j-bennet commented 2 years ago

The fix is now merged to the main branch. Because it's not released yet, you could try it out by uninstalling pgcli from Homebrew, and installing it from github:

pip install git+https://github.com/dbcli/pgcli.git

See if this works for you.

dbaty commented 8 months ago

The fix has been included in pgcli 3.4.1, which has been released in March 2022. It's time we close this. :)