Subject: Re: problem with portal

From: postarch (Postgres Mailing Archive)
Date: Tue, 03 Mar 92 14:32:11 PST

you write:

> Welcome to the C POSTGRES terminal monitor
> 
> Go 
> * \p
> 
> begin
> retrieve  (portal myportal) 
> from pgu in pg_user
> fetch all myportal 
> end
> 
> 
> Go 
> * \g
> 
> Query sent to backend is "begin retrieve  (portal myportal)  from pgu in pg_u
 +ser fetch all myportal  end  "
> WARN:Mar  1 14:13:29:parser: syntax error at or near "portal"

The system is correct here in pointing out that your syntax is wrong.

> Go 
> * \p
> 
> begin
> retrieve portal myportal (pg_user.all) 
> fetch all in myportal 
> close myportal
> end
> 
> 
> Go 
> * \g
> 
> Query sent to backend is "begin retrieve portal myportal (pg_user.all)  fetch
 + all in myportal  close myportal end  "
> WARN:Mar  1 14:20:39:Named portals may only be used in begin/end transaction 
 +blocks.

The syntax is right but postgres has a problem handling multiple queries
sent all at once.  If instead you do:

	begin \g
	retrieve portal myportal (pg_user.all) \g
	fetch all in myportal \g
	close myportal \g
	end \g

I believe it will work.

Jeff