Re: rows and array - Mailing list pgsql-general

From Richard Huxton
Subject Re: rows and array
Date
Msg-id 421B2CDB.90103@archonet.com
Whole thread Raw
In response to Re: rows and array  ("FERREIRA William (COFRAMI)" <william.ferreira@airbus.com>)
Responses Re: rows and array  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
FERREIRA William (COFRAMI) wrote:
> i want do to it in a stored procedure using the pl/pgSQL language.
> i can't use "ORDER by" because the traitment is very specific.
>
> for example, in oracle syntaxe i can create my own type :
>     type recordChild is TABLE OF XDB_CHILD%ROWTYPE
> and next when i declare my variable with this type :
>     children recordChild;
> i can store rows and re-order them like this :
> children(i-j) := children(i-j-1);

Well, I'd look at one of three solutions:
  1. Functional index to order by
  2. Temporary table (read up on EXECUTE and OID caching)
  3. pl/perl/python (which are better suited to this sort of thing)

Probably worth looking into functional indexes - might be what you need.
--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Brar Piening
Date:
Subject: Is there a way to implicitly grant privileges to an implicitly created sequence?
Next
From: Bruno Wolff III
Date:
Subject: Re: Off-topic: monograph for database postgraduate