Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving error "got no result from the query" #45

Open
kishaningithub opened this issue Dec 11, 2022 · 4 comments
Open

Receiving error "got no result from the query" #45

kishaningithub opened this issue Dec 11, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@kishaningithub
Copy link
Contributor

kishaningithub commented Dec 11, 2022

Coping the content from #40 (comment) here for better visibility

I am getting the error got no result from the query even though the query actually wrote a result set (screenshot below)

Should i raise a separate issue or should this be reopened?

Screenshot 1

Screenshot 2022-11-19 at 5 22 30 PM

One interesting thing here is that if i fire the same query very fast i actually get the result "at times" (Screenshot below)

Screenshot 2

Screenshot 2022-11-19 at 5 24 26 PM

Something wierd is going on.

Logs when the error happens

{"level":"debug","timestamp":"2022-11-19T17:25:48.402488+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:67","msg":"incoming command","length":944,"type":"P"}
{"level":"debug","timestamp":"2022-11-19T17:25:48.402723+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:276","msg":"incoming extended query","query":"SELECT n.nspname as \"Schema\",\n                    c.relname as \"Name\",\n                    CASE c.relkind\n                      WHEN 'r' THEN 'table' WHEN 'v' THEN 'view'\n                      WHEN 'p' THEN 'partitioned table'\n                      WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index'\n                      WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special'\n                      WHEN 'f' THEN 'foreign table' END\n                    as \"Type\",\n                    pg_catalog.pg_get_userbyid(c.relowner) as \"Owner\"\n          \n            FROM    pg_catalog.pg_class c\n                    LEFT JOIN pg_catalog.pg_namespace n\n                      ON n.oid = c.relnamespace\n            WHERE   c.relkind = ANY($1) \n            AND n.nspname <> 'pg_catalog'\n            AND n.nspname <> 'information_schema'\n            AND n.nspname !~ '^pg_toast'\n            AND pg_catalog.pg_table_is_visible(c.oid)  ORDER BY 1, 2","name":"","parameters":1}
{"level":"debug","timestamp":"2022-11-19T17:25:48.402844+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:67","msg":"incoming command","length":36,"type":"B"}
{"level":"debug","timestamp":"2022-11-19T17:25:48.40287+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:344","msg":"reading parameters format codes","length":1}
{"level":"debug","timestamp":"2022-11-19T17:25:48.402902+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:372","msg":"reading parameters values","length":1}
{"level":"debug","timestamp":"2022-11-19T17:25:48.402913+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:386","msg":"incoming parameter","value":"{r,p,v,m,S,f,\"\"}"}
{"level":"debug","timestamp":"2022-11-19T17:25:48.402923+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:397","msg":"reading result-column format codes","length":1}
{"level":"debug","timestamp":"2022-11-19T17:25:48.402958+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:67","msg":"incoming command","length":6,"type":"D"}
{"level":"debug","timestamp":"2022-11-19T17:25:48.402977+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:67","msg":"incoming command","length":9,"type":"E"}
{"level":"debug","timestamp":"2022-11-19T17:25:48.402986+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:435","msg":"executing","name":"","limit":0}
{"level":"debug","timestamp":"2022-11-19T17:25:49.791743+05:30","caller":"psql-wire@v0.4.1-0.20221115092616-2480a4e5fc17/command.go:67","msg":"incoming command","length":4,"type":"S"}

Originally posted by @kishaningithub in #40 (comment)

@kishaningithub kishaningithub changed the title Receiving error got no result from the query Receiving error "got no result from the query" Dec 11, 2022
@jeroenrinzema jeroenrinzema added the bug Something isn't working label Dec 27, 2022
@jeroenrinzema
Copy link
Owner

@kishaningithub I am not able to reproduce this issue anymore after the latest changes. Would you be able to check whether this issue has been resolved?

@kishaningithub
Copy link
Contributor Author

kishaningithub commented Jan 16, 2023

@jeroenrinzema The above issue seems to be gone but instead i am getting this one from pgcli (screenshot below). Any idea on what might be causing it? Let me know if this should be a separate issue

Screenshot 2023-01-16 at 2 42 18 PM

Logs

{"level":"debug","timestamp":"2023-01-16T14:41:17.366398+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":944,"type":"P"}
{"level":"debug","timestamp":"2023-01-16T14:41:17.366544+05:30","caller":"psql-wire@v0.5.1/command.go:278","msg":"incoming extended query","query":"SELECT n.nspname as \"Schema\",\n                    c.relname as \"Name\",\n                    CASE c.relkind\n                      WHEN 'r' THEN 'table' WHEN 'v' THEN 'view'\n                      WHEN 'p' THEN 'partitioned table'\n                      WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index'\n                      WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special'\n                      WHEN 'f' THEN 'foreign table' END\n                    as \"Type\",\n                    pg_catalog.pg_get_userbyid(c.relowner) as \"Owner\"\n          \n            FROM    pg_catalog.pg_class c\n                    LEFT JOIN pg_catalog.pg_namespace n\n                      ON n.oid = c.relnamespace\n            WHERE   c.relkind = ANY($1) \n            AND n.nspname <> 'pg_catalog'\n            AND n.nspname <> 'information_schema'\n            AND n.nspname !~ '^pg_toast'\n            AND pg_catalog.pg_table_is_visible(c.oid)  ORDER BY 1, 2","name":"","parameters":1}
{"level":"debug","timestamp":"2023-01-16T14:41:17.366617+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":36,"type":"B"}
{"level":"debug","timestamp":"2023-01-16T14:41:17.366632+05:30","caller":"psql-wire@v0.5.1/command.go:346","msg":"reading parameters format codes","length":1}
{"level":"debug","timestamp":"2023-01-16T14:41:17.366722+05:30","caller":"psql-wire@v0.5.1/command.go:374","msg":"reading parameters values","length":1}
{"level":"debug","timestamp":"2023-01-16T14:41:17.366732+05:30","caller":"psql-wire@v0.5.1/command.go:388","msg":"incoming parameter","value":"{r,p,v,m,S,f,\"\"}"}
{"level":"debug","timestamp":"2023-01-16T14:41:17.36674+05:30","caller":"psql-wire@v0.5.1/command.go:399","msg":"reading result-column format codes","length":1}
{"level":"debug","timestamp":"2023-01-16T14:41:17.366827+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":6,"type":"D"}
{"level":"debug","timestamp":"2023-01-16T14:41:17.366838+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":9,"type":"E"}
{"level":"debug","timestamp":"2023-01-16T14:41:17.366845+05:30","caller":"psql-wire@v0.5.1/command.go:437","msg":"executing","name":"","limit":0}
{"level":"debug","timestamp":"2023-01-16T14:41:18.890619+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":4,"type":"S"}

@jeroenrinzema
Copy link
Owner

jeroenrinzema commented Jan 17, 2023

@kishaningithub are you getting this error after reproducing the steps above? Would you be able to include the --echo-hidden flag to the pgcli in order to inspect the queries the client is generating?

@kishaningithub
Copy link
Contributor Author

Sorry for my delay in response. There does not seem to be an --echo-hidden flag or an equivalent in pgcli. So I ran the same in both psql and pgcli. psql one succeeded whereas the pgcli one failed (Screenshot below)

image

Following is the query that is being run by pgcli (got from the debug logs of psql-wire)

SELECT n.nspname as "Schema",
                    c.relname as "Name",
                    CASE c.relkind
                      WHEN 'r' THEN 'table' WHEN 'v' THEN 'view'
                      WHEN 'p' THEN 'partitioned table'
                      WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index'
                      WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special'
                      WHEN 'f' THEN 'foreign table' END
                    as "Type",
                    pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
          
            FROM    pg_catalog.pg_class c
                    LEFT JOIN pg_catalog.pg_namespace n
                      ON n.oid = c.relnamespace
            WHERE   c.relkind = ANY($1) 
            AND n.nspname <> 'pg_catalog'
            AND n.nspname <> 'information_schema'
            AND n.nspname !~ '^pg_toast'
            AND pg_catalog.pg_table_is_visible(c.oid)  ORDER BY 1, 2

Parameters

$1 => {r,p,v,m,S,f,""}

Log lines

{"level":"debug","timestamp":"2023-02-24T14:36:32.279674+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":944,"type":"P"}
{"level":"debug","timestamp":"2023-02-24T14:36:32.279971+05:30","caller":"psql-wire@v0.5.1/command.go:278","msg":"incoming extended query","query":"SELECT n.nspname as \"Schema\",\n                    c.relname as \"Name\",\n                    CASE c.relkind\n                      WHEN 'r' THEN 'table' WHEN 'v' THEN 'view'\n                      WHEN 'p' THEN 'partitioned table'\n                      WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index'\n                      WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special'\n                      WHEN 'f' THEN 'foreign table' END\n                    as \"Type\",\n                    pg_catalog.pg_get_userbyid(c.relowner) as \"Owner\"\n          \n            FROM    pg_catalog.pg_class c\n                    LEFT JOIN pg_catalog.pg_namespace n\n                      ON n.oid = c.relnamespace\n            WHERE   c.relkind = ANY($1) \n            AND n.nspname <> 'pg_catalog'\n            AND n.nspname <> 'information_schema'\n            AND n.nspname !~ '^pg_toast'\n            AND pg_catalog.pg_table_is_visible(c.oid)  ORDER BY 1, 2","name":"","parameters":1}
{"level":"debug","timestamp":"2023-02-24T14:36:32.280147+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":36,"type":"B"}
{"level":"debug","timestamp":"2023-02-24T14:36:32.280161+05:30","caller":"psql-wire@v0.5.1/command.go:346","msg":"reading parameters format codes","length":1}
{"level":"debug","timestamp":"2023-02-24T14:36:32.280219+05:30","caller":"psql-wire@v0.5.1/command.go:374","msg":"reading parameters values","length":1}
{"level":"debug","timestamp":"2023-02-24T14:36:32.280244+05:30","caller":"psql-wire@v0.5.1/command.go:388","msg":"incoming parameter","value":"{r,p,v,m,S,f,\"\"}"}
{"level":"debug","timestamp":"2023-02-24T14:36:32.28025+05:30","caller":"psql-wire@v0.5.1/command.go:399","msg":"reading result-column format codes","length":1}
{"level":"debug","timestamp":"2023-02-24T14:36:32.280291+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":6,"type":"D"}
{"level":"debug","timestamp":"2023-02-24T14:36:32.280301+05:30","caller":"psql-wire@v0.5.1/command.go:67","msg":"incoming command","length":9,"type":"E"}
{"level":"debug","timestamp":"2023-02-24T14:36:32.280308+05:30","caller":"psql-wire@v0.5.1/command.go:437","msg":"executing","name":"","limit":0}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants