Re: What does this error message mean?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: What does this error message mean?
Date: 2013-11-18 02:20:04
Message-ID: 30952.1384741204@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com> writes:
> Hi. I got an error message reported to me that I've never seen before, and
> I'm not quite sure what it means or what would cause it.

> ERROR: type of parameter 70 (text) does not match that when preparing the
> plan (unknown) CONTEXT: PL/pgSQL function
> generate_payments(date,text,integer,integer) line 195 at assignment

I think this must mean that you changed the schema of table tbl_payment
during this session, and then re-ran the function. plpgsql isn't as good
as it could be about dealing with intra-session changes of composite
types. The reference to "parameter 70" seems a bit odd though, it doesn't
seem like you have anywhere near 70 variables in that function ...

> (And BTW, how exactly is that line number counted? Does the "CREATE
> FUNCTION" statement count as line 1?

In recent versions, the opening quote of the function's body string counts
as line 1. If your attachment came through without extra wrapping, I'm
counting this as line 195:

pay_test.comment=payment.comment;

(thinks about it for a bit) Actually it seems more likely that a change
in the rowtype of "payment" caused this, ie some change in the output
column set of that "final_query" query. Difficult to guess more than
that without more context.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tony Theodore 2013-11-18 02:57:32 Re: Composite types or composite keys?
Previous Message Hengky Liwandouw 2013-11-18 02:16:15 Help : Sum 2 tables based on key from other table