Comments (5)
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.
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.
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.
Some inputs on SO
from periods.
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)
- syntax error on Windows HOT 3
- Is this bi-temporal + scd approach correct ? HOT 3
- Capitalised role throws error on add_system_versioning HOT 7
- Usage of "_as_of ()"
- Add support for custom system time
- Support for Range types (e.g. tstzrange?)
- Support system versioning for views HOT 6
- Allow history table to be partitioned
- Crash on PG14 HOT 2
- Can't adjust GRANTs after backup and restore
- How to migrate from temporal_tables?
- QUESTION: How to handle Schema changes?
- Why version 1.2 is not visible in my pg14 ? HOT 6
- Foreign key constraints allow inconsistent state?
- Installation error HOT 2
- error when inserting new record HOT 1
- installations instructions
- Remove add_period from a table HOT 2
- relation "example2__for_portion_of_validity" does not exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from periods.