pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #14465: cursor for insert into select ... returning cann't streaming fetch?
3+ messages / 3 participants
[nested] [flat]
* BUG #14465: cursor for insert into select ... returning cann't streaming fetch?
@ 2016-12-14 02:56 digoal@126.com
2016-12-14 03:57 ` Re: BUG #14465: cursor for insert into select ... returning cann't streaming fetch? David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: digoal@126.com @ 2016-12-14 02:56 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 14465
Logged by: Zhou Digoal
Email address: digoal@126.com
PostgreSQL version: 9.6.1
Operating system: CentOS 6.x x64
Description:
HI,
when i write a plpgsql return refcursor.
the refcursor is a ```insert into .. select .. from .. returning *;```
query.
but when i use auto_explain DEBUG it, i found the fetch after insert end,
not stream , insert and fetch the same time coordinat.
can PostgreSQL improve it?
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #14465: cursor for insert into select ... returning cann't streaming fetch?
2016-12-14 02:56 BUG #14465: cursor for insert into select ... returning cann't streaming fetch? digoal@126.com
@ 2016-12-14 03:57 ` David G. Johnston <david.g.johnston@gmail.com>
2016-12-14 06:59 ` Re: BUG #14465: cursor for insert into select ... returning cann't streaming fetch? 德哥 <digoal@126.com>
0 siblings, 1 reply; 3+ messages in thread
From: David G. Johnston @ 2016-12-14 03:57 UTC (permalink / raw)
To: digoal@126.com <digoal@126.com>; +Cc: pgsql-bugs
On Tuesday, December 13, 2016, <digoal@126.com> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14465
> Logged by: Zhou Digoal
> Email address: digoal@126.com <javascript:;>
> PostgreSQL version: 9.6.1
> Operating system: CentOS 6.x x64
> Description:
>
> HI,
> when i write a plpgsql return refcursor.
> the refcursor is a ```insert into .. select .. from .. returning *;```
> query.
> but when i use auto_explain DEBUG it, i found the fetch after insert
> end,
> not stream , insert and fetch the same time coordinat.
> can PostgreSQL improve it?
>
>
This isn't a bug.
Opening a cursor causes it to execute, which in this case means performing
the insert. You can only return opened cursors from a function. The act
of fetching from the cursor simply gives access to the underlying rows.
Not sure what improvement you are wanting here but a posting to -general
would be more appropriate. Describing your use case would help others
understand why this might be useful.
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #14465: cursor for insert into select ... returning cann't streaming fetch?
2016-12-14 02:56 BUG #14465: cursor for insert into select ... returning cann't streaming fetch? digoal@126.com
2016-12-14 03:57 ` Re: BUG #14465: cursor for insert into select ... returning cann't streaming fetch? David G. Johnston <david.g.johnston@gmail.com>
@ 2016-12-14 06:59 ` 德哥 <digoal@126.com>
0 siblings, 0 replies; 3+ messages in thread
From: 德哥 @ 2016-12-14 06:59 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-bugs
HI,
thank you , my case is retrive data stream , i cann't wait the insert end.
because insert has very large tuples, like 1M, and client will wait many seconds, if user can fetch the result the same time when inserting, it will reduce the waiting time.
--
公益是一辈子的事,I'm Digoal,Just Do It.
在 2016-12-14 11:57:00,"David G. Johnston" <david.g.johnston@gmail.com> 写道:
On Tuesday, December 13, 2016, <digoal@126.com> wrote:
The following bug has been logged on the website:
Bug reference: 14465
Logged by: Zhou Digoal
Email address: digoal@126.com
PostgreSQL version: 9.6.1
Operating system: CentOS 6.x x64
Description:
HI,
when i write a plpgsql return refcursor.
the refcursor is a ```insert into .. select .. from .. returning *;```
query.
but when i use auto_explain DEBUG it, i found the fetch after insert end,
not stream , insert and fetch the same time coordinat.
can PostgreSQL improve it?
This isn't a bug.
Opening a cursor causes it to execute, which in this case means performing the insert. You can only return opened cursors from a function. The act of fetching from the cursor simply gives access to the underlying rows.
Not sure what improvement you are wanting here but a posting to -general would be more appropriate. Describing your use case would help others understand why this might be useful.
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2016-12-14 06:59 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-12-14 02:56 BUG #14465: cursor for insert into select ... returning cann't streaming fetch? digoal@126.com
2016-12-14 03:57 ` David G. Johnston <david.g.johnston@gmail.com>
2016-12-14 06:59 ` 德哥 <digoal@126.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