a question about exec_simple_query()

Started by 汪琦over 17 years ago2 messages
#1汪琦
billywq@163.com

Hi, everyone:

In functin exec_simple_query(), why we run a simple query wrapped in a portal.

For instance:

version 8.3.0 ,postgres.c, Line 908

/*
* Create unnamed portal to run the query or queries in. If there
* already is one, silently drop it.
*/
portal = CreatePortal("", true, true);

......

In other words, what's the benifit we use a portal to run a simple query?

Thanks for your help! :)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: 汪琦 (#1)
Re: a question about exec_simple_query()

"=?GB2312?Q?=CD=F4=E7=F9?=" <billywq@163.com> writes:

In other words, what's the benifit we use a portal to run a simple query?

er, because it doesn't work otherwise?

regards, tom lane