Re: row numbering - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: row numbering
Date
Msg-id 200502281928.04467.peter_e@gmx.net
Whole thread Raw
In response to Re: row numbering  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Responses Re: row numbering
List 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/

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: row numbering
Next
From: Bruno Wolff III
Date:
Subject: Re: row numbering