Re: plpgsql FOR LOOP CTE problem ?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: "Day, David" <dday(at)redcom(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpgsql FOR LOOP CTE problem ?
Date: 2013-08-09 22:06:21
Message-ID: 520567DD.1000404@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/09/2013 02:18 PM, Day, David wrote:
> A complete self contained test case: example of the problem with my FOR LOOP using a COMMON table expression.
> Again this is version 9.3beta
>
> Any comments

Got it past the error by:

Changing:

drow test.tmm%ROWTYPE; -- deleted row holder

to:

drow record; -- deleted row holder

SELECT translator_id, MIN(tid_seq), MIN(ws_grp_seq)
FROM xrows GROUP BY translator_id

to:

SELECT translator_id, MIN(tid_seq) as tid_seq, MIN(ws_grp_seq) as
ws_grp_seq
FROM xrows GROUP BY translator_id

MIN() becomes a column min which is not in the %ROWTYPE for test.tmm

>

>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2013-08-09 22:11:42 Re: incremental dumps
Previous Message Kevin Grittner 2013-08-09 21:28:21 Re: bi-directional syncing help request