Re: database design with temporary tables - Mailing list pgsql-general

From Ray O'Donnell
Subject Re: database design with temporary tables
Date
Msg-id 7d2c5ed8-ad27-611e-7717-f3c5e3aa4995@rodonnell.ie
Whole thread Raw
In response to Re: database design with temporary tables  (ourdiaspora <ourdiaspora@protonmail.com>)
Responses Re: database design with temporary tables  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: database design with temporary tables  (ourdiaspora <ourdiaspora@protonmail.com>)
List pgsql-general
On 29/08/2021 17:36, ourdiaspora wrote:
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> 
> On Sunday, August 29th, 2021 at 5:24 PM, Adrian Klaver
> <adrian.klaver@aklaver.com> wrote:
> 
>> 
>> Presumably not. Temporary tables only live at most for the length
>> of a
>> 
>> session. It would be a really bad idea to hold sessions open for
>> 24
>> 
>> hours.
> 
> Is there an alternative scenario, such as the user is able to create
> a new table with saves the session data for a maximum time (such as
> 24 hours), even up to a certain time if the web browser crashes for
> example?

I'd save a timestamp with the session data, and then run a cron job 
which deletes sessions older than whatever lifetime you want.

Ray.



-- 
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie



pgsql-general by date:

Previous
From: ourdiaspora
Date:
Subject: Re: database design with temporary tables
Next
From: ourdiaspora
Date:
Subject: Re: database design with temporary tables