Search Postgresql Archives

Re: rows and array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Title: RE: rows and array

i don't want to do the re-ordering on the client side.
i want a stored procedure which extract some rows from a database into an array.
next i have a function for re-ordering the array depending on specific needs
and finally generate a XML file on the server


-----Message d'origine-----
De : pgsql-general-owner@xxxxxxxxxxxxxx
[mailto:pgsql-general-owner@xxxxxxxxxxxxxx]De la part de Tom Lane
Envoyé : mardi 22 février 2005 16:29
À : Richard Huxton
Cc : FERREIRA William (COFRAMI); 'pgsql-general@xxxxxxxxxxxxxx'
Objet : Re: rows and array


Richard Huxton <dev@xxxxxxxxxxxx> writes:
> FERREIRA William (COFRAMI) wrote:
>> 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)

I think what he's saying is he wants to do the re-ordering on the client
side.  This seems trivial enough.  If I were doing it against a libpq
result set, I'd probably not bother to sort the physical rows; I'd just
make an array of integers representing row numbers in the PGresult and
sort the row numbers, then use those numbers to pull out the fields when
it came time to display 'em.  (Another way to say that is that a
PGresult *is* an array, it's just got a funny access syntax.)

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

This mail has originated outside your organization,
either from an external partner or the Global Internet.
Keep this in mind if you answer this message.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux