Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA01543; Tue, 3 Mar 92 14:32:23 -0800
Message-Id: <9203032232.AA01543@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: problem with portal
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Reply-To: mer@postgres.berkeley.edu
In-Reply-To: Your message of "Sun, 01 Mar 92 15:26:30 PST."
             <9203012326.AA01946@postgres.Berkeley.EDU> 
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
