BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE
Дата
Msg-id 17439-7df4421197e928f0@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17439
Logged by:          Kevin Humphreys
Email address:      kmanh999@gmail.com
PostgreSQL version: 13.3
Operating system:   docker linux
Description:

We have the following DDL

create table schemaA.building
(
    id            integer default
nextval('layer0_data.instance_id_seq'::regclass) not null
        primary key
        unique,
    serial_number text,
    name          text
      not null,
    geometry      geometry(Geometry, 4326)
        constraint geom_check
            check (geometrytype(geometry) = ANY (ARRAY ['POLYGON'::text,
'MULTIPOLYGON'::text, 'POINT'::text])),
    feature_id    integer
        unique
        references route.feature
            on update restrict on delete restrict,
    type          text
      not null
        references layer0_enum.building_type
            on update restrict on delete restrict,
    ownership     text
      not null
        references layer0_enum.building_ownership
            on update restrict on delete restrict,
    height        numeric default 0
      not null,
    length        numeric default 0
      not null,
    width         numeric default 0
      not null,
    import_info   text,
    altname       text,
    iversion      text,
    area          double precision generated always as (map.area(geometry))
stored
);

If I execute `DROP FUNCTION IF EXISTS map.area(geometry)`, it should error
out saying it is depended on by building.area. However, instead it
successfully drops map.area(geometry) and also drops the building.area
column. According to the documentation, RESTRICT is the default so it should
refuse to drop instead of dropping the column unless I explicitly call DROP
using CASCADE.


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

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17440: not expected result from jsonb_path_query