Simplify redability of some tests for toast_tuple_target instrings.sql

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Simplify redability of some tests for toast_tuple_target instrings.sql
Дата
Msg-id 20190403065949.GH3298@paquier.xyz
обсуждение исходный текст
Ответы Re: Simplify redability of some tests for toast_tuple_target in strings.sql  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Hi all,

Some tests for toast_tuple_target introduced by c251336 check if a
toast relation is empty or not using that:
+select 0 = pg_relation_size('pg_toast.pg_toast_'||(select oid from
pg_class where relname =
'toasttest'))/current_setting('block_size')::integer as blocks;

This is overcomplicated as there is not need to compile the relation
toast name, and reltoastrelid can be used directly, like that:
SELECT pg_relation_size(reltoastrelid) = 0 AS data_size
  FROM pg_class where relname = 'toasttest';

Any objections if I simplify those tests as per the attached?
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: [PATCH v20] GSSAPI encryption support
Следующее
От: David Rowley
Дата:
Сообщение: Re: COPY FROM WHEN condition