Re: temporary tables ?

From: "Zlatko Matic" <zlatko(dot)matic1(at)sb(dot)t-com(dot)hr>
To: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
Cc: "pgsql list" <pgsql-general(at)postgresql(dot)org>
Subject: Re: temporary tables ?
Date: 2005-07-24 09:44:08
Message-ID: 004501c59034$3d8c2120$3d8b1dc3@zlatkovyfkpgz6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for explaination.
Zlatko

----- Original Message -----
From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: "Zlatko Matic" <zlatko(dot)matic1(at)sb(dot)t-com(dot)hr>
Cc: "pgsql list" <pgsql-general(at)postgresql(dot)org>
Sent: Sunday, July 24, 2005 1:27 AM
Subject: Re: [GENERAL] temporary tables ?

>
>
>
>> What is the influence on database growing in comparrison to permanent
>> table frequently inserted/deleted rows ?
>
> The tables are dropped automatically after the connection is closed. The
> database doesn't grow because of temporary tables. As for comparison to a
> frequently inserted/deleted table, that would depend on the time between
> vacuums. The rows aren't "removed" from a table until a vacuum is
> performed.
>
>>> On Jul 22, 2005, at 1:55 PM, Zlatko Matic wrote:
>>>
>>>> Hello.
>>>> I have some tables that are updated by several users in the same time
>>>> and are used in queries for reports. Those tables have rows that are
>>>> actualy copied from original tables that are not to be altered. There
>>>> is a procedure that inserts rows for every user when connects, along
>>>> with his username, so different users can't interfere with each other
>>>> because every user has his own copy of rows that he can update, and
>>>> records are filtered by current_user.
>>>> Well, it's my heritage from MS Access, before I moved to Postgres,
>>>> because there is no such thing as temporary table in Access...
>>>> Now, I'm wondering is there any true advantage to implement temporary
>>>> tables for each user, insted of one table with inserted rows with
>>>> username for every user ?
>>>
>>> Temporary tables are not per-user, but per-connection. A user can be
>>> connected twice, but a temporary table created on one connection is not
>>> visible from the other connection. Also, temporary tables are
>>> temporary--they disappear after the connection is closed.
>>>
>>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Rawnsley 2005-07-24 10:44:51 pg_resetxlog question
Previous Message Oleg Bartunov 2005-07-24 09:12:54 Re: tsearch2 frequent updates