Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)

From: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)
Date: 2016-08-17 09:50:59
Message-ID: 20160817125059.0fb42420@e733
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> That doesn't really solve the problem, because OTHER backends won't be
> able to see them. So, if I create a fast temporary table in one
> session that depends on a permanent object, some other session can
> drop the permanent object. If there were REAL catalog entries, that
> wouldn't work, because the other session would see the dependency.
>

This is a good point. However current implementation doesn't allow to
do that. There is a related bug though, a minor one.

In session 1:

```
CREATE TABLE cities2 (name text, population float, altitude int);
CREATE FAST TEMPORARY TABLE capitals2 (state char(2)) INHERITS (cities2);
```

In session 2:

```
DROP TABLE cities2;

ERROR: cache lookup failed for relation 16401
```

Instead of "cache lookup failed" probably a better error message
should be displayed. Something like "cannot drop table cities2 because
other objects depend on it". I will send a corrected patch shortly.

Everything else seems to work as expected.

If you discover any other bugs please let me know!

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2016-08-17 10:02:08 Re: [GENERAL] C++ port of Postgres
Previous Message Victor Wagner 2016-08-17 09:34:37 Re: Use pread and pwrite instead of lseek + write and read