sort by update - Mailing list pgsql-general

From Sim Zacks
Subject sort by update
Date
Msg-id h0qhf3$be6$1@news.hub.org
Whole thread Raw
List pgsql-general
The following code works to update a table in order with a sequence.
I have tried it on a number of different types of fields.

create temporary sequence seq_1;

update tbl1 set currentsort=nextval('seq_1')
from (select tbl1id from tbl1 order by tbl1id) b
where tbl1.tbl1id=b.tbl1id;

drop sequence seq_1;

My question is, will it always work? In other words is it programmed
that way or is this an unintended feature that might stop working sometime.

Thanks
Sim

pgsql-general by date:

Previous
From: David
Date:
Subject: When to use cascading deletes?
Next
From: "Shakil Shaikh"
Date:
Subject: Array Parameters in EXECUTE