Re: row numbering

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: row numbering
Date: 2005-02-28 18:28:04
Message-ID: 200502281928.04467.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Karsten Hilbert wrote:
> There are 5 vaccinations in a given vaccination schedule.
>
> Patient had 3 shots.
>
> I want the view to show me that shot 4 and 5 are missing
> without having to enter the cardinality of the vaccination in
> the original data.

That sounds like you are trying to abuse the data model, so I'm not
surprised that it isn't easily possible. As the data stored in a table
is inherently unordered, you can't really talk about order unless you
impose it yourself by way of assigning ordinal numbers or some other
sort key to your rows.

Even if you could, say, assign a fixed order to tables or views or
actually had some kind of automatic row number available, that would
still make the semantics of your data dependent of the particularities
of the queries that you use to access it, which doesn't sound like a
good idea to me.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2005-02-28 18:31:03 Re: Possible to run the server with ANSI/ISO string escapeing
Previous Message Bruno Wolff III 2005-02-28 18:24:46 Re: Possible to run the server with ANSI/ISO string