Re: Temporary tables usage in functions

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Yambu <hyambu(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Temporary tables usage in functions
Date: 2020-11-09 12:52:40
Message-ID: CAFj8pRC1ima-xi1MMnuaa+a89Z+b=m4z1Yp6MF7t2q0abZ8+dg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

po 9. 11. 2020 v 13:07 odesílatel Yambu <hyambu(at)gmail(dot)com> napsal:

> Hi
>
> May I know if a temporary table is dropped at the end of a function?
>

PostgreSQL temporary tables can be dropped on the end of transaction or end
of session.

>
> Also may I know if excessive use of temporary tables may cause locks?
>

Usually there are no problems with locks, but there is a problem with
system tables bloating. Creating and dropping temp tables is expensive like
creating or dropping normal tables.

Against other databases, there can be used arrays instead temporary tables.
This is significantly more effective.

Regards

Pavel

> regards
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yambu 2020-11-09 13:46:06 RAISE INFO in function
Previous Message Josef Šimánek 2020-11-09 12:18:04 Re: Temporary tables usage in functions