Re: Advise on primary key for detail tables (OS: Raspberry Pi)

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Ertan Küçükoğlu <ertan(dot)kucukoglu(at)1nar(dot)com(dot)tr>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Advise on primary key for detail tables (OS: Raspberry Pi)
Date: 2017-04-06 14:57:55
Message-ID: CAOR=d=0KYVHtWa51fkTo58kMttvCMeLGkZV6QMCaqLL3-tRfPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Apr 6, 2017 at 4:27 AM, Ertan Küçükoğlu
<ertan(dot)kucukoglu(at)1nar(dot)com(dot)tr> wrote:
> Sorry for top posting.
>
> I have a serial in master table because I need to know data insertion order.
> DateTime on Raspberry Pi is not accurate due to power loss and lack of
> internet access to fetch correct time from.

Note that serial / sequences do NOT guarantee exact order of
insertion. It's quite possible to have a few switched here and there.
It gets you an approximate order of insertion but a few values could
get swapped around depending on timing of your application and how you
do inserts. Just an FYI.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2017-04-06 15:04:03 Re: A change in the Debian install
Previous Message Moreno Andreo 2017-04-06 14:53:44 Re: Archiving data to another server using copy, psql with pipe