Re: [HACKERS] ALTER PUBLICATION and segmentation fault - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: [HACKERS] ALTER PUBLICATION and segmentation fault
Date
Msg-id CAD21AoD0NEaVXDZ0P_0_J42aX2-TGqZTBZQfD37ird8tZKE1xA@mail.gmail.com
Whole thread Raw
In response to [HACKERS] ALTER PUBLICATION and segmentation fault  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: [HACKERS] ALTER PUBLICATION and segmentation fault  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On Wed, Mar 8, 2017 at 12:45 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
> Hi,
>
> When I logged in PostgreSQL as non-superuser and ran
> ALTER PUBLICATION command, I got a segmentation fault.
> The code checking the owner of publication might have a bug.
>
> =# CREATE ROLE foo NOSUPERUSER LOGIN
> =# \c - foo
> => \dRp
>               List of publications
>  Name  |  Owner   | Inserts | Updates | Deletes
> -------+----------+---------+---------+---------
>  mypub | postgres | t       | t       | t
> => ALTER PUBLICATION mypub RENAME TO hoge;
>
> LOG:  server process (PID 80356) was terminated by signal 11: Segmentation fault
> DETAIL:  Failed process was running: ALTER PUBLICATION mypub RENAME TO hoge;
>

This issue happen even ALTER SUBSCRIPTION. I guess the main cause is
that acl_kind of pg_publication and pg_subscription of ObjectProperty
array are not correct. These values should be set ACL_KIND_PUBLICATION
and ACL_KIND_SUBSCRIPTION instead of -1. Attached small patch fixes
this issue and adds regression test.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

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

Attachment

pgsql-hackers by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: [HACKERS] PATCH: Batch/pipelining support for libpq
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Proposal : Parallel Merge Join