improve plpgsql's EXECUTE 'select into' message with a hint

Поиск
Список
Период
Сортировка
Искать

improve plpgsql's EXECUTE 'select into' message with a hint

От:
Jaime Casanova <jcasanov@systemguards.com.ec>
Дата:
Вложения:
Hi,

while TFM says that we can use EXECUTE 'select ' INTO instead of the
non implemented EXECUTE 'select ... into ', the message in plpgsql
fails to say the same thing... seems like a HINT to me

-- 
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

Re: improve plpgsql's EXECUTE 'select into' message with a hint

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Jaime Casanova wrote:
> Hi,
> 
> while TFM says that we can use EXECUTE 'select ' INTO instead of the
> non implemented EXECUTE 'select ... into ', the message in plpgsql
> fails to say the same thing... seems like a HINT to me

Applied with attached patch.  Thanks.

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + None of us is going to be here forever. +

Index: src/pl/plpgsql/src/pl_exec.c
===================================================================
RCS file: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v
retrieving revision 1.257
diff -c -c -r1.257 pl_exec.c
*** src/pl/plpgsql/src/pl_exec.c	14 Apr 2010 23:52:10 -0000	1.257
--- src/pl/plpgsql/src/pl_exec.c	31 May 2010 19:59:45 -0000
***************
*** 3033,3039 ****
  				if (*ptr == 'S' || *ptr == 's')
  					ereport(ERROR,
  							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
! 					errmsg("EXECUTE of SELECT ... INTO is not implemented")));
  				break;
  			}
  
--- 3033,3040 ----
  				if (*ptr == 'S' || *ptr == 's')
  					ereport(ERROR,
  							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
! 					errmsg("EXECUTE of SELECT ... INTO is not implemented"),
! 					errhint("You might want to use EXECUTE ... INTO instead.")));
  				break;
  			}
  
FAQ