Re: Skip ExecCheckRTPerms in CTAS with no data

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Skip ExecCheckRTPerms in CTAS with no data
Дата
Msg-id 20201112090607.GF1871@paquier.xyz
обсуждение исходный текст
Ответ на Re: Skip ExecCheckRTPerms in CTAS with no data  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Skip ExecCheckRTPerms in CTAS with no data
Список pgsql-hackers
On Wed, Nov 11, 2020 at 07:31:49PM +0530, Bharath Rupireddy wrote:
> Yes we do not have anything related to permissions mentioned in the
> documentation. So, I'm not adding it now.

It would be good to clarify that in the docs while we are on it.

> Apart from the above, I also noticed that we unnecessarily allocate
> bulk insert state(16MB memory) in case of WITH NO DATA, just to free
> it in intorel_shutdown() without actually using it. So, in the v2
> patch I have made changes to not allocate bulk insert state.
>
> Attaching v2 patch. Consider it for further review.

+EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
+    CREATE TABLE selinto_schema.tmp0 (a) AS
+    SELECT oid FROM pg_class WHERE relname like '%c%' WITH NO DATA; -- OK

I don't think this is sufficient.  Could you add more test cases here?
I can think of, coming down actually to the callers of
CreateIntoRelDestReceiver:
- A plain CTAS WITH NO DATA, that should pass,
- CTAS EXECUTE WITH NO DATA, that should pass.
- CTAS EXECUTE WITH DATA, that should not pass.
- EXPLAIN CTAS WITH DATA, that should not pass.
--
Michael

Вложения

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

Предыдущее
От: Ajin Cherian
Дата:
Сообщение: Re: [HACKERS] logical decoding of two-phase transactions
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: logical streaming of xacts via test_decoding is broken