Re: PL/pgSQL CURSOR support

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: PL/pgSQL CURSOR support
Дата
в 13:39:24
Msg-id
200105311716.f4VHGFS28125@candle.pha.pa.us
Ответ на
Список
Дерево обсуждения
Re: PL/pgSQL CURSOR support "Sergey E. Volkov" <sve@raiden.bancorp.ru>

Jan has approved the following patch that allows both FOR and IS for
PL/PgSQL cursors.

> >     DECLARE    CURSOR IS  is the Oracle PL/SQL
> >     syntax. Since PL/pgSQL was written from the  start  with  one
> >     eye  on  portability  from/to  Oracle, I'd like to stick with
> >     that.
> > 
> >     It's relatively simple to just substitute  all  PLpgSQL  (and
> >     other case combos) occurences by something else, then replace
> >     the gram.y and scan.l files with whatever you want and voila,
> >     you come up with another procedural language as compatible as
> >     possible to your formerly preferred  database.  There  is  no
> >     reason  other  than  that  we'll  have  more  PL  handlers to
> >     support,  why  we  shouldn't  have  two  or  three  different
> >     procedural  SQL dialects. All can coexist and only those used
> >     in your DB schema will get loaded.
> 
> OK, how about this patch that allows both FOR and IS.  Seems like a
> good idea, and we can document FOR.
> 
> Also, I don't see any documentation on the new plpgsql cursor support.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: src/pl/plpgsql/src/gram.y
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v
retrieving revision 1.19
diff -c -r1.19 gram.y
*** src/pl/plpgsql/src/gram.y	2001/05/21 14:22:18	1.19
--- src/pl/plpgsql/src/gram.y	2001/05/30 20:05:03
***************
*** 355,361 ****
  					{
  						plpgsql_ns_rename($2, $4);
  					}
! 				| decl_varname K_CURSOR decl_cursor_args K_IS K_SELECT decl_cursor_query
  					{
  						PLpgSQL_var *new;
  						PLpgSQL_expr *curname_def;
--- 355,361 ----
  					{
  						plpgsql_ns_rename($2, $4);
  					}
! 				| decl_varname K_CURSOR decl_cursor_args decl_is_from K_SELECT decl_cursor_query
  					{
  						PLpgSQL_var *new;
  						PLpgSQL_expr *curname_def;
***************
*** 499,505 ****
  						plpgsql_ns_push(NULL);
  					}
  				;
! 				
  
  decl_aliasitem	: T_WORD
  					{
--- 499,507 ----
  						plpgsql_ns_push(NULL);
  					}
  				;
! 
! decl_is_from	:	K_IS |		/* Oracle */
! 					K_FOR;		/* ANSI */
  
  decl_aliasitem	: T_WORD
  					{
В списке pgsql-hackers по дате отправления
От: Lamar Owen
Дата:
От: Luis Magaña
Дата:
Сообщение: pg_dump & pg_dumpall problem.
FAQ