Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relation "example2__for_portion_of_validity" does not exist #33

Open
obelix74 opened this issue Feb 10, 2023 · 1 comment
Open

relation "example2__for_portion_of_validity" does not exist #33

obelix74 opened this issue Feb 10, 2023 · 1 comment

Comments

@obelix74
Copy link

CREATE TABLE example2 (
    id bigint,
	value text,
    start_date date,
    end_date date,
    CONSTRAINT example2_pkey PRIMARY KEY (id, start_date, end_date)
);

SELECT periods.add_period('example2', 'validity', 'start_date', 'end_date');
SELECT periods.add_unique_key('example2', ARRAY['id'], 'validity', unique_constraint => 'example2_pkey');

insert into example2 values(1, 'one', '2022-01-01', '2022-12-31');
select * from example2;

update example2__for_portion_of_validity
	set value='one one',
	start_date='2022-03-01',
	end_date='2022-05-01'
where id=1;

This fails with:

ERROR:  relation "example2__for_portion_of_validity" does not exist
LINE 1: update example2__for_portion_of_validity
               ^
SQL state: 42P01
Character: 8

Am I doing something wrong?

@posenato
Copy link

posenato commented Dec 14, 2024

I met the same issue.

I found that it is possible to add such a view by

select periods.add_for_portion_view('example2','validity');

In the documentation, there are no instructions for issuing such a command.

I am wondering if it is correct to run it explicitly.

Roberto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants