pg_class(relpersistence) of hash index

Started by Antonin Houskaabout 11 years ago2 messages
#1Antonin Houska
ah@cybertec.at

While checking how BM_PERMANENT flag is set (in buffer header), I noticed that
hash index has it set too. Shouldn't pg_class(relpersistence) be 'u' in this
case? Currently it's set to 'p':

postgres=# CREATE TABLE a(i int);
CREATE TABLE
postgres=# CREATE INDEX ON a USING HASH (i);
WARNING: hash indexes are not WAL-logged and their use is discouraged
CREATE INDEX
postgres=# \d a
Table "public.a"
Column | Type | Modifiers
--------+---------+-----------
i | integer |
Indexes:
"a_i_idx" hash (i)

postgres=# select relpersistence from pg_class where relname='a_i_idx';
relpersistence
----------------
p
(1 row)

--
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de, http://www.cybertec.at

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Antonin Houska (#1)
Re: pg_class(relpersistence) of hash index

Antonin Houska <ah@cybertec.at> writes:

While checking how BM_PERMANENT flag is set (in buffer header), I noticed that
hash index has it set too. Shouldn't pg_class(relpersistence) be 'u' in this
case?

See archives; we do not currently have a way to support unlogged indexes
on logged tables. The whole hash-index mess would be better if we did,
but getting there is less than trivial.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers