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

Started by Jaime Casanovaover 15 years ago2 messages
#1Jaime Casanova
jcasanov@systemguards.com.ec
1 attachment(s)

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

Attachments:

plpgsql-hint.patchtext/x-patch; charset=US-ASCII; name=plpgsql-hint.patchDownload
Index: src/pl/plpgsql/src/pl_exec.c
===================================================================
RCS file: /home/postgres/pg_repo/pgsql/src/pl/plpgsql/src/pl_exec.c,v
retrieving revision 1.257
diff -r1.257 pl_exec.c
3036c3036,3037
< 					errmsg("EXECUTE of SELECT ... INTO is not implemented")));
---
> 					errmsg("EXECUTE of SELECT ... INTO is not implemented"),
> 					errhint("You may want to use EXECUTE ... INTO instead.")));
#2Bruce Momjian
bruce@momjian.us
In reply to: Jaime Casanova (#1)
1 attachment(s)
Re: improve plpgsql's EXECUTE 'select into' message with a hint

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 <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

Attachments:

/rtmp/difftext/x-diffDownload
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;
  			}