From 29e3ef0fe96ecf24e88f72465c6d9e13600eea9d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 26 Feb 2002 00:00:08 +0000 Subject: [PATCH] Use quote-marks to try to clarify a plpgsql error message, per gripe from Dan Langille. --- src/pl/plpgsql/src/pl_exec.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index d61fac5289..c3f4578617 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -3,7 +3,7 @@ * procedural language * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.52 2001/11/15 23:31:09 tgl Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.53 2002/02/26 00:00:08 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -1621,7 +1621,7 @@ exec_stmt_raise(PLpgSQL_execstate * estate, PLpgSQL_stmt_raise * stmt) { fno = SPI_fnumber(rec->tupdesc, recfield->fieldname); if (fno == SPI_ERROR_NOATTRIBUTE) - elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname); + elog(ERROR, "record \"%s\" has no field named \"%s\"", rec->refname, recfield->fieldname); extval = SPI_getvalue(rec->tup, rec->tupdesc, fno); if (extval == NULL) extval = ""; @@ -1786,10 +1786,10 @@ exec_prepare_plan(PLpgSQL_execstate * estate, rec = (PLpgSQL_rec *) (estate->datums[recfield->recno]); if (!HeapTupleIsValid(rec->tup)) - elog(ERROR, "record %s is unassigned yet", rec->refname); + elog(ERROR, "record \"%s\" is unassigned yet", rec->refname); fno = SPI_fnumber(rec->tupdesc, recfield->fieldname); if (fno == SPI_ERROR_NOATTRIBUTE) - elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname); + elog(ERROR, "record \"%s\" has no field named \"%s\"", rec->refname, recfield->fieldname); argtypes[i] = SPI_gettypeid(rec->tupdesc, fno); break; @@ -1871,10 +1871,10 @@ exec_stmt_execsql(PLpgSQL_execstate * estate, rec = (PLpgSQL_rec *) (estate->datums[recfield->recno]); if (!HeapTupleIsValid(rec->tup)) - elog(ERROR, "record %s is unassigned yet", rec->refname); + elog(ERROR, "record \"%s\" is unassigned yet", rec->refname); fno = SPI_fnumber(rec->tupdesc, recfield->fieldname); if (fno == SPI_ERROR_NOATTRIBUTE) - elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname); + elog(ERROR, "record \"%s\" has no field named \"%s\"", rec->refname, recfield->fieldname); if (expr->plan_argtypes[i] != SPI_gettypeid(rec->tupdesc, fno)) elog(ERROR, "type of %s.%s doesn't match that when preparing the plan", rec->refname, recfield->fieldname); @@ -2415,10 +2415,10 @@ exec_stmt_open(PLpgSQL_execstate * estate, PLpgSQL_stmt_open * stmt) rec = (PLpgSQL_rec *) (estate->datums[recfield->recno]); if (!HeapTupleIsValid(rec->tup)) - elog(ERROR, "record %s is unassigned yet", rec->refname); + elog(ERROR, "record \"%s\" is unassigned yet", rec->refname); fno = SPI_fnumber(rec->tupdesc, recfield->fieldname); if (fno == SPI_ERROR_NOATTRIBUTE) - elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname); + elog(ERROR, "record \"%s\" has no field named \"%s\"", rec->refname, recfield->fieldname); if (query->plan_argtypes[i] != SPI_gettypeid(rec->tupdesc, fno)) elog(ERROR, "type of %s.%s doesn't match that when preparing the plan", rec->refname, recfield->fieldname); @@ -2711,7 +2711,7 @@ exec_assign_value(PLpgSQL_execstate * estate, * structure. */ if (!HeapTupleIsValid(rec->tup)) - elog(ERROR, "record %s is unassigned yet - don't know its tuple structure", rec->refname); + elog(ERROR, "record \"%s\" is unassigned yet - don't know its tuple structure", rec->refname); /* * Get the number of the records field to change and the @@ -2719,7 +2719,7 @@ exec_assign_value(PLpgSQL_execstate * estate, */ fno = SPI_fnumber(rec->tupdesc, recfield->fieldname); if (fno == SPI_ERROR_NOATTRIBUTE) - elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname); + elog(ERROR, "record \"%s\" has no field named \"%s\"", rec->refname, recfield->fieldname); fno--; natts = rec->tupdesc->natts; @@ -2914,10 +2914,10 @@ exec_run_select(PLpgSQL_execstate * estate, rec = (PLpgSQL_rec *) (estate->datums[recfield->recno]); if (!HeapTupleIsValid(rec->tup)) - elog(ERROR, "record %s is unassigned yet", rec->refname); + elog(ERROR, "record \"%s\" is unassigned yet", rec->refname); fno = SPI_fnumber(rec->tupdesc, recfield->fieldname); if (fno == SPI_ERROR_NOATTRIBUTE) - elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname); + elog(ERROR, "record \"%s\" has no field named \"%s\"", rec->refname, recfield->fieldname); if (expr->plan_argtypes[i] != SPI_gettypeid(rec->tupdesc, fno)) elog(ERROR, "type of %s.%s doesn't match that when preparing the plan", rec->refname, recfield->fieldname); @@ -3052,10 +3052,10 @@ exec_eval_simple_expr(PLpgSQL_execstate * estate, rec = (PLpgSQL_rec *) (estate->datums[recfield->recno]); if (!HeapTupleIsValid(rec->tup)) - elog(ERROR, "record %s is unassigned yet", rec->refname); + elog(ERROR, "record \"%s\" is unassigned yet", rec->refname); fno = SPI_fnumber(rec->tupdesc, recfield->fieldname); if (fno == SPI_ERROR_NOATTRIBUTE) - elog(ERROR, "record %s has no field %s", rec->refname, recfield->fieldname); + elog(ERROR, "record \"%s\" has no field named \"%s\"", rec->refname, recfield->fieldname); if (expr->plan_argtypes[i] != SPI_gettypeid(rec->tupdesc, fno)) elog(ERROR, "type of %s.%s doesn't match that when preparing the plan", rec->refname, recfield->fieldname); -- 2.40.0