pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ray Madigan <ray@madigans.org>
To: Pgsql-Sql <pgsql-sql@postgresql.org>
Subject: LOOP?
Date: Thu, 17 Feb 2005 08:59:14 -0800
Message-ID: <AEEJIDLCICLNLPOJHFEEAEFDFCAA.ray@madigans.org> (raw)

I am writing a trigger to inspect a row of a temporary table to determine if
the row has any null columns,  I will return as soon as I find a null
column.  I ran across this in the manual and It seems like I could use

The FOR-IN-EXECUTE statement is another way to iterate over rows:
[<<label>>]
FOR record_or_row IN EXECUTE text_expression LOOP
statements
END LOOP;

postgresql has a RECORD type which is an abstract row.

Does it have any fields to tell the length?

Does it have an accessor function like new.element(index};

I am trying to write a general function where from instance to instance the
columns in the record change.  If I can't do this I will have to create a
new function for each temporary table.

Is this possible or should I quit looking;

FOR record IN {something related to NEW } LOOP

END LOOP;





view thread (2+ messages)  latest in thread

Message-ID: <AEEJIDLCICLNLPOJHFEEAEFDFCAA.ray@madigans.org>
Permalink:  ../AEEJIDLCICLNLPOJHFEEAEFDFCAA.ray@madigans.org/
Also on:    postgresql.org/message-id/AEEJIDLCICLNLPOJHFEEAEFDFCAA.ray@madigans.org

 · 

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: ray@madigans.org
  Subject: Re: LOOP?
  In-Reply-To: <AEEJIDLCICLNLPOJHFEEAEFDFCAA.ray@madigans.org>

* 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