pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Galbavy <peter.galbavy@knowtion.net>
To: pgsql-sql@postgresql.org
Subject: techniques for manual ordering of data ?
Date: Sat, 7 Feb 2004 10:47:37 -0000
Message-ID: <007101c3ed67$cdab35f0$24e0a8c0@sonylaptop> (raw)

I tried googling, but the keywords here are so general, that I couldn't find
much useful.

I am looking for reommendations on how to build an ordered list of media (in
this case photographs) in a particular "context". What I have - which I have
somewhat simplified maually - is:

CREATE TABLE contexts (
    photo_id        int8 REFERENCES photos ...,
    catalogue_id    int8 REFERENCES catalogues ...,
    collection_id   int8 REFERENCES collections ...,

    ordering        int
);

Here, a photograph may appear in multiple catalogue/collection places. What
I want to do is to allow the admin to reorder the display by using + / -
style buttons. My initial thought was to use an arbitrary "ordering" column,
like old BASIC line numbers, which would be initially allocated in 10s or
100s, and then updating the value via the UI and occassionally applying a
"renum" style function when the list gets uneven.

To avoid performance hits through too many updates, I am trying to avoid the
admin UI from UPDATEing all the rows in a specific catalogue/collection
every time a button is pressed - both the SQL and the subsequent fragmented
table. Hmm.

Anyone got any "prior art" or suggestions on how they acheive this ?

Note that I am NOT including ordering based on an photograph specific
metadata like time or location. That's another story and another interface.

rgds,
--
Peter




view thread (3+ messages)  latest in thread

Message-ID: <007101c3ed67$cdab35f0$24e0a8c0@sonylaptop>
Permalink:  ../007101c3ed67$cdab35f0$24e0a8c0@sonylaptop/
Also on:    postgresql.org/message-id/007101c3ed67$cdab35f0$24e0a8c0@sonylaptop

 · 

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: peter.galbavy@knowtion.net
  Subject: Re: techniques for manual ordering of data ?
  In-Reply-To: <007101c3ed67$cdab35f0$24e0a8c0@sonylaptop>

* 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