linz / postgresql-tableversion

PostgreSQL table versioning management software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot version unversioned table (inconsistent view on the matter)

strk opened this issue · comments

See this session:

lol_3_17=# select table_version.ver_version();
1.7.0dev 1.6.0-16-g7fabb6f
lol_3_17=# select table_version.ver_is_table_versioned('bde_ext', 'adjustment_run');
f
lol_3_17=# select table_version.ver_enable_versioning('bde_ext', 'adjustment_run');
ERROR:  Table bde_ext.adjustment_run is already versioned

Basically, ver_is_table_versioned says a table is NOT versioned while ver_enable_versioning says the table is ALREADY versioned... annoying enough

There's no trigger on the table:

lol_3_17=# \d bde_ext.adjustment_run
                Table "bde_ext.adjustment_run"
       Column       |            Type             | Modifiers 
--------------------+-----------------------------+-----------
 id                 | integer                     | not null
 adm_id             | integer                     | not null
 cos_id             | integer                     | not null
 status             | character varying(4)        | not null
 usr_id_exec        | character varying(20)       | not null
 adjust_datetime    | timestamp without time zone | 
 description        | character varying(100)      | 
 sum_sqrd_residuals | numeric(22,12)              | 
 redundancy         | numeric(22,12)              | 
 wrk_id             | integer                     | 
 audit_id           | integer                     | not null
Indexes:
    "pkey_adjustment_run" PRIMARY KEY, btree (id)

The table_version.versioned_table table is empty.
The only thing is that a table_version.bde_ext_adjustment_run_revision table exists.

What should we do in these cases ?
Shall we consider the table as versioned or non-versioned ?

I think it should be considered as non-versioned. How has that happen ?

commented

This issue has been automatically marked as stale as there has not been any activity for sometime. The issue will be closed in 14 days if no further activity.

This task is still relevant.

commented

This issue has been automatically marked as stale as there has not been any activity for sometime. The issue will be closed in 14 days if no further activity.

This task is still relevant.

commented

This issue has been automatically marked as stale as there has not been any activity for sometime. The issue will be closed in 14 days if no further activity.

This task is still relevant.

This seems like quite an edge case. Would require someone to drop cascade and then rebuild with schema loader.