On Wed, Oct 07, 2009 at 09:19:58PM +0200, Zsolt wrote: > For a given house I would like to start the numbering of tenants from > 1. Each house could have tenant_ID=1, obviously in this case the > house_ID will differ. The combination of tenant_ID and house_ID will > be the unique identifier of each tenant. The term for this that tends to float around for this concept (in PG anyway) is "gap-less sequences": this looks like a reasonable link: http://www.varlena.com/GeneralBits/130.php -- Sam http://samason.me.uk/ -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general