Skip to content

Warns when dropping non partitioned temp tables #271

Open
@DavidPavlicek

Description

@DavidPavlicek

Hi,
we used pg_pathman for a long time, but last week, our log got totally bloated with warns from pg_pathman. Something like this

WARNING: only the owner or superuser can change partitioning configuration of table "poi_data"
Context: SQL statement "DELETE FROM public.pathman_config WHERE partrel = ANY(relids)" PL/pgSQL function pathman_ddl_trigger_func() line 17 at SQL statement SQL statement "drop table if exists m_pomtabtr" PL/pgSQL function delikt_gis.precti_delikty_predpcr(integer,integer,integer,integer,integer,timestamp without time zone,timestamp without time zone,character varying) line 54 at SQL statement

The dropped table is a temp table and is definitely not partitioned in pg_pathman.

I'm not aware of any changes in our setup and nothing suspicious got logged around the time when warns started appearing in logs (around 01:10 AM), no DNF update, nothing.

More interestingly warns appear when dropping different temp tables under different users. I'm stuck. Maybe something in conjunction with PgBouncer and/or Timescale. Timescale has its event triggers for DDL, but they should be executed after pg_pathman triggers. Maybe PgBouncer messed up something within sessions...

I temporarily fix this by testing relids against pathman_config before delete is executed inside pathman_ddl_trigger_func()...

if exists(select 1 from public.pathman_config where partrel = any(relids)) then
    /* Cleanup pathman_config */
    DELETE FROM public.pathman_config WHERE partrel = ANY(relids);

    /* Cleanup params table too */
    DELETE FROM public.pathman_config_params WHERE partrel = ANY(relids);
end if;

After this mod, warns disappears. Any thoughts on this?

Environment

Extensions

extname extversion
plpgsql 1.0
postgis 3.1.3
postgis_raster 3.1.3
pg_pathman 1.5
unaccent 1.1
btree_gist 1.5
hstore 1.7
intarray 1.3
pg_buffercache 1.3
pg_prewarm 1.2
pg_stat_statements 1.8
pg_trgm 1.5
pgstattuple 1.5
tablefunc 1.0
timescaledb 2.5.1

Version
PostgreSQL 13.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4), 64-bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions