Error when rewriting a query into multiple queries

From: "Huang Wang" <hwang(at)rhrk(dot)uni-kl(dot)de>
To: pgsql-general(at)postgresql(dot)org
Cc: h_wang21(at)informatik(dot)uni-kl(dot)de
Subject: Error when rewriting a query into multiple queries
Date: 2021-11-19 23:04:15
Message-ID: ximss-229849332@mail1.uni-kl.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Sir or Madam,

I'm trying to add progressive query into Postgres. Assume a query 'SELECT *
FROM hugetable', my idea is to rewrite it into several queries as
'SELECT * FROM hugetable TABLESAMPLE SYSTEM_TIME(500)'
'SELECT * FROM hugetable TABLESAMPLE SYSTEM_TIME(1000)'
'SELECT * FROM hugetable TABLESAMPLE SYSTEM_TIME(1500)'
the first query will provide real-time results to the user and the following
queries will return later for more accurate results. However, I got a
'[42601]: ERROR: cannot insert multiple commands into a prepared statement'
error after I modified postgres.c or parser.c. Is there any way to do it on
the server or it's better to do it in the application? Thank you for your
help.

Best regards,
Wang

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc Millas 2021-11-20 02:13:41 Re: Execute command in PL/pgSQL function not executing
Previous Message David G. Johnston 2021-11-19 22:48:02 Re: Execute command in PL/pgSQL function not executing