pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Denis BUCHER <dbucherml@hsolutions.ch>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problem with return type of function ??? (corrected)
Date: Thu, 22 Oct 2009 16:38:45 +0200
Message-ID: <4AE06E75.9010305@hsolutions.ch> (raw)
In-Reply-To: <29935.1256222015@sss.pgh.pa.us>
References: <4AE046E4.8010205@hsolutions.ch>
	<29935.1256222015@sss.pgh.pa.us>

Hello Tom,

Tom Lane a écrit :
> Denis BUCHER <dbucherml@hsolutions.ch> writes:
>> I have a strange problem, because it worked in a fonction for a table,
>> and now I created the same (?) function for another table and it doesn't
>> work...
> 
>> The function is accepted but at runtime I get :
> 
>> ERREUR:  wrong record type supplied in RETURN NEXT
>> CONTEXTE : PL/pgSQL function "find_sn_live" line 26 at return next
> 
> Does that table have any dropped columns?  If you don't remember
> whether you ever dropped any columns, a quick look into pg_attribute
> will tell you:
> select attname from pg_attribute where attrelid = 'rma.serial_number'::regclass;

Yes !

           attname
------------------------------
 tableoid
 cmax
 xmax
 cmin
 xmin
 ctid
 sn_id
 sn
 no_client
 no_art_bw
 sn_fc_date
 ........pg.dropped.6........
 ........pg.dropped.7........
 desc_fr
 sn_cm_date
 no_facture
 no_commande
(17 lignes)

> plpgsql isn't tremendously good with rowtypes that contain dropped
> columns.  I believe this particular case is fixed in CVS HEAD, but the
> patch was a bit invasive and won't get back-ported to existing releases.
> The workaround is to drop and recreate the table without any dropped
> columns.

OH, I see...

Thanks a lot, I will try this later today when nobody uses the
application...


Denis



view thread (8+ messages)  latest in thread

Message-ID: <4AE06E75.9010305@hsolutions.ch>
Permalink:  ../4AE06E75.9010305@hsolutions.ch/
Also on:    postgresql.org/message-id/4AE06E75.9010305@hsolutions.ch

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dbucherml@hsolutions.ch, tgl@sss.pgh.pa.us
  Subject: Re: Problem with return type of function ??? (corrected)
  In-Reply-To: <4AE06E75.9010305@hsolutions.ch>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox