Re: Drawbacks of using BYTEA for PK?

From: "John Sidney-Woollett" <johnsw(at)wardbrook(dot)com>
To: "Chris Travers" <chris(at)travelamericas(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Drawbacks of using BYTEA for PK?
Date: 2004-01-13 08:50:05
Message-ID: 2680.192.168.0.64.1073983805.squirrel@mercury.wardbrook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Careful...

If two (or more) clients (in the same network) are going through a
firewall that performs NAT, then they could appear to have the same IP
address if the NAT address pool is small (single address).

Appending a sequence would help resolve that issue though.

John Sidney-Woollett

Chris Travers said:
>
> ----- Original Message -----
> From: "Alex Satrapa" <alex(at)lintelsys(dot)com(dot)au>
>> As long as you don't use RFC1918 addresses, the IPv4 address(es) of the
>> host should be unique for the Internet. Append/prepend a 32 bit
>> timestamp and you have a 64bit unique identifier that is "universally"
>> unique (to one second).
>
> Aarrgh... So if you have 2 inserts in the same second, you have key
> collision? Why not append a sequence to that so you have: Unique address
> || timestamp || sequence value. In a case such as this I can see why you
> might want to use md5() to hash that value.
>
> Best Wishes,
> Chris Travers
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Garamond 2004-01-13 09:20:09 Re: Drawbacks of using BYTEA for PK?
Previous Message Chris Travers 2004-01-13 08:40:47 Re: Any way to SELECT a list of table names?