Re: Improve readability by using designated initializers when possible

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Japin Li <japinli(at)hotmail(dot)com>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Jeff Davis <pgsql(at)j-davis(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improve readability by using designated initializers when possible
Date: 2024-03-20 14:08:39
Message-ID: 26345df1-24d6-4691-824d-a70641fb5e62@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18.03.24 11:01, jian he wrote:
> select relname from pg_class where relisshared and relkind = 'r';
> relname
> -----------------------
> pg_authid
> pg_subscription
> pg_database
> pg_db_role_setting
> pg_tablespace
> pg_auth_members
> pg_shdepend
> pg_shdescription
> pg_replication_origin
> pg_shseclabel
> pg_parameter_acl
> (11 rows)
>
> EventTriggerSupportsObject should return false for the following:
> SharedSecLabelRelationId
> SharedDescriptionRelationId
> DbRoleSettingRelationId
> SharedDependRelationId
>
> but I am not sure ReplicationOriginRelationId.

EventTriggerSupportsObject() (currently named
EventTriggerSupportsObjectClass()) is only used by the deletion code,
and these additional classes are not supported there anyway. Also, if
they happen to show up there for some reason, then
EventTriggerSQLDropAddObject() would error out in
getObjectIdentityParts() or getObjectTypeDescription(). So you wouldn't
get an event trigger firing on a previously unsupported class by
accident. So I think this is robust enough.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakub Wartak 2024-03-20 14:17:28 Re: pg_upgrade --copy-file-range
Previous Message Daniel Gustafsson 2024-03-20 14:03:45 Re: sslinfo extension - add notbefore and notafter timestamps