[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-recutils] Counters and Unique IDs

From: John Darrington
Subject: [bug-recutils] Counters and Unique IDs
Date: Mon, 21 Oct 2013 18:57:14 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Oct 16, 2013 at 12:20:13PM +0200, Jose E. Marchesi wrote:
         Sections "Counters" and "Unique Identifiers"
          I'm not sure what should go here.  This again seems to be things not
         yet implemented. Delete?
     That is about %auto, which can be used to implement automatically
     incremented counters and also unique identifiers in databases.

I'm confused here.

1.   What is the difference between a "counter" and a 
"unique identidier"?  I would have guessed that a counter is merely a
special case of a unique id.  A counter is obviously integer, whereas
(in my way of thinking) a unique id could be a string.  However, in
recutils %auto may only be used with integers and dates and a few other
very special types.

2.  How exactly to set up a counter in recutils is also not clear.
The naive answer would be thus:

%auto: counter
%type: counter int

This kindof works, but for a few problems:

a) If there already happens to be two records with 
   counter: 4  recfix will neither detect nor fix that.

b) This could be overcome by adding the field %key: counter however,
   there might already be a primary key for this record set in which
   case that would not be allowed.

3. Unique IDS are also difficult in the following situation:  Sometimes
   I want a field which may or may not exist.  However IF it exists
   then I want it to be unique.  Nieither %auto nor %key will help here.
   Perhaps it could be done with %constraint, but I don't see how.

Can you suggest examples how these situations could be done?


PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]