pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Error when rewriting a query into multiple queries
2+ messages / 2 participants
[nested] [flat]

* Error when rewriting a query into multiple queries
@ 2021-11-19 23:04 Huang Wang <hwang@rhrk.uni-kl.de>
  2021-11-21 17:59 ` Re: Error when rewriting a query into multiple queries David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Huang Wang @ 2021-11-19 23:04 UTC (permalink / raw)
  To: pgsql-general; +Cc: h_wang21@informatik.uni-kl.de

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







^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Error when rewriting a query into multiple queries
  2021-11-19 23:04 Error when rewriting a query into multiple queries Huang Wang <hwang@rhrk.uni-kl.de>
@ 2021-11-21 17:59 ` David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2021-11-21 17:59 UTC (permalink / raw)
  To: Huang Wang <hwang@rhrk.uni-kl.de>; +Cc: pgsql-general; h_wang21@informatik.uni-kl.de <h_wang21@informatik.uni-kl.de>

On Friday, November 19, 2021, Huang Wang <hwang@rhrk.uni-kl.de> wrote:

> Is there any way to do it on the server or it's better to do it in the
> application?
>

Application; and for me at least modifying the server to do this is an
extremely bad idea that goes against its fundamental design.

David J.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-11-21 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 23:04 Error when rewriting a query into multiple queries Huang Wang <hwang@rhrk.uni-kl.de>
2021-11-21 17:59 ` David G. Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox