pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
database design with temporary tables
16+ messages / 5 participants
[nested] [flat]

* database design with temporary tables
@ 2021-08-29 16:10 ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 16+ messages in thread

From: ourdiaspora @ 2021-08-29 16:10 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Readers,

Some advice would be appreciated about appropriate tables to store temporary data.

Scenario:
User copies csv file of user data, presumably into some temporary table(s);
User selects data (read-only) from extant tables;
Web server combines user data with read-only data to produce content visible to user as html and/or pdf document;
User does not need to sign in to use web page, only the user e-mail address;
User data deleted (including e-mail address) after time (e.g. 24 hours) and/or user selects to receive combined data via e-mail (after which all user data is automatically deleted).

What part of the documention would be most relevant to read firstly, please?






^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
@ 2021-08-29 16:24 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:30   ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:36   ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 17:41   ` Re: database design with temporary tables Mladen Gogala <gogala.mladen@gmail.com>
  0 siblings, 3 replies; 16+ messages in thread

From: Adrian Klaver @ 2021-08-29 16:24 UTC (permalink / raw)
  To: ourdiaspora <ourdiaspora@protonmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On 8/29/21 9:10 AM, ourdiaspora wrote:
> Readers,
> 
> Some advice would be appreciated about appropriate tables to store temporary data.
> 
> Scenario:
> User copies csv file of user data, presumably into some temporary table(s);

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. That is assuming nothing else causes the session to drop and the 
data to be lost.

> User selects data (read-only) from extant tables;
> Web server combines user data with read-only data to produce content visible to user as html and/or pdf document;
> User does not need to sign in to use web page, only the user e-mail address;
> User data deleted (including e-mail address) after time (e.g. 24 hours) and/or user selects to receive combined data via e-mail (after which all user data is automatically deleted).
> 
> What part of the documention would be most relevant to read firstly, please?

The abo
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
@ 2021-08-29 16:30   ` Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:38     ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2 siblings, 1 reply; 16+ messages in thread

From: Adrian Klaver @ 2021-08-29 16:30 UTC (permalink / raw)
  To: ourdiaspora <ourdiaspora@protonmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On 8/29/21 9:24 AM, Adrian Klaver wrote:
> On 8/29/21 9:10 AM, ourdiaspora wrote:
>> Readers,
>>

>> User selects data (read-only) from extant tables;
>> Web server combines user data with read-only data to produce content 
>> visible to user as html and/or pdf document;
>> User does not need to sign in to use web page, only the user e-mail 
>> address;
>> User data deleted (including e-mail address) after time (e.g. 24 
>> hours) and/or user selects to receive combined data via e-mail (after 
>> which all user data is automatically deleted).
>>
>> What part of the documention would be most relevant to read firstly, 
>> please?
> 
> The abo

Whoops, unfinished thought. What I was going to ask is:

The above is not clear to me. Are you asking about the Postgres 
documentation?


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:30   ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
@ 2021-08-29 16:38     ` ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:46       ` Re: database design with temporary tables David G. Johnston <david.g.johnston@gmail.com>
  2021-08-29 16:53       ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 2 replies; 16+ messages in thread

From: ourdiaspora @ 2021-08-29 16:38 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Sunday, August 29th, 2021 at 5:30 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:

> On 8/29/21 9:24 AM, Adrian Klaver wrote:
>
>
> Whoops, unfinished thought. What I was going to ask is:
>
> The above is not clear to me. Are you asking about the Postgres
>
> documentation?
>

Yes, wanted to know relevant parts because often the first problem is to know which part of the (extensive) documentation to read...






^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:30   ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:38     ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
@ 2021-08-29 16:46       ` David G. Johnston <david.g.johnston@gmail.com>
  1 sibling, 0 replies; 16+ messages in thread

From: David G. Johnston @ 2021-08-29 16:46 UTC (permalink / raw)
  To: ourdiaspora <ourdiaspora@protonmail.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On Sunday, August 29, 2021, ourdiaspora <ourdiaspora@protonmail.com> wrote:
>
>
> Yes, wanted to know relevant parts because often the first problem is to
> know which part of the (extensive) documentation to read...
>
>
Suggest you just start developing.  When you get stuck the nature of the
block should inform where to go looking for answers.  Or at least formulate
more specific questions.

David J.

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:30   ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:38     ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
@ 2021-08-29 16:53       ` Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:56         ` Re: database design with temporary tables Ray O'Donnell <ray@rodonnell.ie>
  1 sibling, 1 reply; 16+ messages in thread

From: Adrian Klaver @ 2021-08-29 16:53 UTC (permalink / raw)
  To: ourdiaspora <ourdiaspora@protonmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On 8/29/21 9:38 AM, ourdiaspora wrote:
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> 
> On Sunday, August 29th, 2021 at 5:30 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
>> On 8/29/21 9:24 AM, Adrian Klaver wrote:
>>
>>
>> Whoops, unfinished thought. What I was going to ask is:
>>
>> The above is not clear to me. Are you asking about the Postgres
>>
>> documentation?
>>
> 
> Yes, wanted to know relevant parts because often the first problem is to know which part of the (extensive) documentation to read...
> 

 From what I see it is basic operations; CREATE TABLE, SELECT, INSERT, 
UPDATE and COPY.

As I said in my previous post create a fairly detailed design flow first 
and from that you will see what operations you need to do and what part 
of the docs you need to look at.

-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:30   ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:38     ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:53       ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
@ 2021-08-29 16:56         ` Ray O'Donnell <ray@rodonnell.ie>
  2021-08-29 17:14           ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  0 siblings, 1 reply; 16+ messages in thread

From: Ray O'Donnell @ 2021-08-29 16:56 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; ourdiaspora <ourdiaspora@protonmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On 29/08/2021 17:53, Adrian Klaver wrote:
> On 8/29/21 9:38 AM, ourdiaspora wrote:
>>
>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>>
>> On Sunday, August 29th, 2021 at 5:30 PM, Adrian Klaver 
>> <adrian.klaver@aklaver.com> wrote:
>>
>>> On 8/29/21 9:24 AM, Adrian Klaver wrote:
>>>
>>>
>>> Whoops, unfinished thought. What I was going to ask is:
>>>
>>> The above is not clear to me. Are you asking about the Postgres
>>>
>>> documentation?
>>>
>>
>> Yes, wanted to know relevant parts because often the first problem is 
>> to know which part of the (extensive) documentation to read...
>>
> 
>  From what I see it is basic operations; CREATE TABLE, SELECT, INSERT, 
> UPDATE and COPY.
> 
> As I said in my previous post create a fairly detailed design flow first 
> and from that you will see what operations you need to do and what part 
> of the docs you need to look at.

+100 to this. Also, it's not clear from your description what is 
happening where - how much functionality is in the database, and how 
much at the web server. Are your users connecting directly to the 
database server? - or do they connect only to the web server, which then 
uses its own account on the database server? Get this clear in your own 
head and much of the rest will follow.

Ray.



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





^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:30   ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:38     ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:53       ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:56         ` Re: database design with temporary tables Ray O'Donnell <ray@rodonnell.ie>
@ 2021-08-29 17:14           ` ourdiaspora <ourdiaspora@protonmail.com>
  0 siblings, 0 replies; 16+ messages in thread

From: ourdiaspora @ 2021-08-29 17:14 UTC (permalink / raw)
  To: ; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>


On Sunday, August 29th, 2021 at 5:56 PM, Ray O'Donnell <ray@rodonnell.ie> wrote:
>
- or do they connect only to the web server, which then
>
> uses its own account on the database server?

Thank you; was not aware of this consideration and this option seems most appropriate for the simple sql commands envisaged.






^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
@ 2021-08-29 16:36   ` ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:38     ` Re: database design with temporary tables Ray O'Donnell <ray@rodonnell.ie>
  2021-08-29 16:50     ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2 siblings, 2 replies; 16+ messages in thread

From: ourdiaspora @ 2021-08-29 16:36 UTC (permalink / raw)
  To: ; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

‐‐‐‐‐‐‐ 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?

>
> The abo
>

Incomplete response?






^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:36   ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
@ 2021-08-29 16:38     ` Ray O'Donnell <ray@rodonnell.ie>
  2021-08-29 16:48       ` Re: database design with temporary tables David G. Johnston <david.g.johnston@gmail.com>
  2021-08-29 16:49       ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  1 sibling, 2 replies; 16+ messages in thread

From: Ray O'Donnell @ 2021-08-29 16:38 UTC (permalink / raw)
  To: ourdiaspora <ourdiaspora@protonmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

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





^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:36   ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:38     ` Re: database design with temporary tables Ray O'Donnell <ray@rodonnell.ie>
@ 2021-08-29 16:48       ` David G. Johnston <david.g.johnston@gmail.com>
  1 sibling, 0 replies; 16+ messages in thread

From: David G. Johnston @ 2021-08-29 16:48 UTC (permalink / raw)
  To: Ray O'Donnell <ray@rodonnell.ie>; +Cc: ourdiaspora <ourdiaspora@protonmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On Sunday, August 29, 2021, Ray O'Donnell <ray@rodonnell.ie> wrote:

>
>>>
>> 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?
>
>
In general a database doesn’t change just because time has passed.  You
will need to setup something external to the database schema if you want
time to cause change.

David J.

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:36   ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:38     ` Re: database design with temporary tables Ray O'Donnell <ray@rodonnell.ie>
@ 2021-08-29 16:49       ` ourdiaspora <ourdiaspora@protonmail.com>
  1 sibling, 0 replies; 16+ messages in thread

From: ourdiaspora @ 2021-08-29 16:49 UTC (permalink / raw)
  To: Ray O'Donnell <ray@rodonnell.ie>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Sunday, August 29th, 2021 at 5:38 PM, Ray O'Donnell <ray@rodonnell.ie> wrote:
>
> I'd save a timestamp with the session data, and then run a cron job
>
> which deletes sessions older than whatever lifetime you want.
>

Is it prudent in this scenario for the user to create (a) tables of her/his data, with role as her/his e-mail address (no password)?






^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 16:36   ` Re: database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
@ 2021-08-29 16:50     ` Adrian Klaver <adrian.klaver@aklaver.com>
  1 sibling, 0 replies; 16+ messages in thread

From: Adrian Klaver @ 2021-08-29 16:50 UTC (permalink / raw)
  To: ourdiaspora <ourdiaspora@protonmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On 8/29/21 9:36 AM, 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?

This is a it depends answer. Some factors in play:

1) Number of users over say a 24 hour period.

2) The size of the CSV files.

3) Is the data merge a one time thing or can it be repeated in a time 
period.

4) Are users going to be repeat customers?

For this sort of thing I write out a detailed outline of the 
who/what/why/where/when. In doing that answers tend to follow.

> 
>>
>> The abo
>>
> 
> Incomplete response?
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
@ 2021-08-29 17:41   ` Mladen Gogala <gogala.mladen@gmail.com>
  2021-08-29 18:26     ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2 siblings, 1 reply; 16+ messages in thread

From: Mladen Gogala @ 2021-08-29 17:41 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org


On 8/29/21 12:24 PM, Adrian Klaver 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. That is assuming nothing else causes the session to drop and 
> the data to be lost. 

Well, that's precisely how application servers work. The allocate 
connection pool and keep them open for a very long time.


-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com






^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 17:41   ` Re: database design with temporary tables Mladen Gogala <gogala.mladen@gmail.com>
@ 2021-08-29 18:26     ` Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 20:35       ` Re: database design with temporary tables Mladen Gogala <gogala.mladen@gmail.com>
  0 siblings, 1 reply; 16+ messages in thread

From: Adrian Klaver @ 2021-08-29 18:26 UTC (permalink / raw)
  To: Mladen Gogala <gogala.mladen@gmail.com>; pgsql-general@lists.postgresql.org

On 8/29/21 10:41 AM, Mladen Gogala wrote:
> 
> On 8/29/21 12:24 PM, Adrian Klaver 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. That is assuming nothing else causes the session to drop and 
>> the data to be lost. 
> 
> Well, that's precisely how application servers work. The allocate 
> connection pool and keep them open for a very long time.

The pool is maintained, the individual connections(sessions) come and 
go. Otherwise there would be no point to having a pool. Every time the 
connection(session) is closed the temporary table disappears.


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: database design with temporary tables
  2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
  2021-08-29 16:24 ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
  2021-08-29 17:41   ` Re: database design with temporary tables Mladen Gogala <gogala.mladen@gmail.com>
  2021-08-29 18:26     ` Re: database design with temporary tables Adrian Klaver <adrian.klaver@aklaver.com>
@ 2021-08-29 20:35       ` Mladen Gogala <gogala.mladen@gmail.com>
  0 siblings, 0 replies; 16+ messages in thread

From: Mladen Gogala @ 2021-08-29 20:35 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@lists.postgresql.org


On 8/29/21 2:26 PM, Adrian Klaver wrote:
> The pool is maintained, the individual connections(sessions) come and 
> go. Otherwise there would be no point to having a pool. Every time the 
> connection(session) is closed the temporary table disappears. 

Yes, you're right. And that is very convenient. I also prefer temporary 
tables with ON COMMIT DELETE ROWS so that I don't have leftovers between 
transactions. There is also pgtt extension by Giles Darold which 
emulates Oracle global temporary tables:

https://github.com/darold/pgtt#use-of-the-extension

I have never particularly liked Oracle's implementation of temporary 
tables, local or global,  so I have no problems with questions like 
that. BTW, I have compared Oracle's implementation with other 
implementations here:

https://dbwhisperer.wordpress.com/2019/03/18/private-temporary-tables-oracle-18c/

I could have used Postgres instead of the SQL Server, the comparison 
would read the same, except for the "#" character which denotes 
temporary table in SQL Server.

Regards


-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com






^ permalink  raw  reply  [nested|flat] 16+ messages in thread


end of thread, other threads:[~2021-08-29 20:35 UTC | newest]

Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-08-29 16:10 database design with temporary tables ourdiaspora <ourdiaspora@protonmail.com>
2021-08-29 16:24 ` Adrian Klaver <adrian.klaver@aklaver.com>
2021-08-29 16:30   ` Adrian Klaver <adrian.klaver@aklaver.com>
2021-08-29 16:38     ` ourdiaspora <ourdiaspora@protonmail.com>
2021-08-29 16:46       ` David G. Johnston <david.g.johnston@gmail.com>
2021-08-29 16:53       ` Adrian Klaver <adrian.klaver@aklaver.com>
2021-08-29 16:56         ` Ray O'Donnell <ray@rodonnell.ie>
2021-08-29 17:14           ` ourdiaspora <ourdiaspora@protonmail.com>
2021-08-29 16:36   ` ourdiaspora <ourdiaspora@protonmail.com>
2021-08-29 16:38     ` Ray O'Donnell <ray@rodonnell.ie>
2021-08-29 16:48       ` David G. Johnston <david.g.johnston@gmail.com>
2021-08-29 16:49       ` ourdiaspora <ourdiaspora@protonmail.com>
2021-08-29 16:50     ` Adrian Klaver <adrian.klaver@aklaver.com>
2021-08-29 17:41   ` Mladen Gogala <gogala.mladen@gmail.com>
2021-08-29 18:26     ` Adrian Klaver <adrian.klaver@aklaver.com>
2021-08-29 20:35       ` Mladen Gogala <gogala.mladen@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox