Giter VIP home page Giter VIP logo

Comments (5)

albert-kam avatar albert-kam commented on May 25, 2024

I also tried re-adding system time period in my restored db, assuming that the periods schema was not dumped and restored:

mydb=# SELECT periods.add_system_time_period('carts', 'sys_start', 'sys_end');
2022-03-17 07:40:26.227 WIB [28301] ERROR:  trigger "carts_system_time_generated_always" for relation "carts" already exists
2022-03-17 07:40:26.227 WIB [28301] CONTEXT:  SQL statement "CREATE TRIGGER carts_system_time_generated_always BEFORE INSERT OR UPDATE ON carts FOR EACH ROW EXECUTE PROCEDURE periods.generated_always_as_row_start_end()"
	PL/pgSQL function add_system_time_period(regclass,name,name,name,name,name,name,name,name[]) line 322 at EXECUTE
2022-03-17 07:40:26.227 WIB [28301] STATEMENT:  SELECT periods.add_system_time_period('carts', 'sys_start', 'sys_end');
ERROR:  trigger "carts_system_time_generated_always" for relation "carts" already exists
CONTEXT:  SQL statement "CREATE TRIGGER carts_system_time_generated_always BEFORE INSERT OR UPDATE ON carts FOR EACH ROW EXECUTE PROCEDURE periods.generated_always_as_row_start_end()"
PL/pgSQL function add_system_time_period(regclass,name,name,name,name,name,name,name,name[]) line 322 at EXECUTE

Notice that the trigger already exists, and below I tried to update one record and it shows the error I was talking about in the original post:

mydb=# update carts set valid_start = now() where id = 1;
2022-03-17 07:41:11.476 WIB [28301] ERROR:  period "system_time" not found on table "carts"
2022-03-17 07:41:11.476 WIB [28301] STATEMENT:  update carts set valid_start = now() where id = 1;
ERROR:  period "system_time" not found on table "carts"




from periods.

albert-kam avatar albert-kam commented on May 25, 2024

When i checked the source, it has something like this:

SELECT p.*
    INTO period_row
    FROM periods.periods AS p
    WHERE (p.table_name, p.period_name) = (table_name, period_name);

    IF NOT FOUND THEN
        RAISE NOTICE 'period % not found on table %', period_name, table_name;
        RETURN false;
    END IF;

This seems to read from periods table, and somehow my pg_dump wouldnt dump anything inside periods schema, thus this error, am i correct ?

from periods.

albert-kam avatar albert-kam commented on May 25, 2024

I just tried dumping with -n periods and --extensions=periods and the tables' data was there in the dump, but omitting the extensions switch did not include the data. I am currently trying to bring in the dump to try restoring. I will keep updating.

from periods.

albert-kam avatar albert-kam commented on May 25, 2024

Some inputs on SO

from periods.

albert-kam avatar albert-kam commented on May 25, 2024

I think i messed up during dump and restore. Now that i retried it again with minimum options on both pg_dump and pg_restore, everything is okay. Even the periods.* are dumpable.

from periods.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.