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

Disadvantages of backup and recovery #1277

Open
frg01 opened this issue Jan 6, 2024 · 2 comments
Open

Disadvantages of backup and recovery #1277

frg01 opened this issue Jan 6, 2024 · 2 comments

Comments

@frg01
Copy link

frg01 commented Jan 6, 2024

I tried to use dump_all and load_all for backup and recovery, but between backup and recovery I tried to uninstall and reinstall the extension, which made the new train impossible. It seems that the new environment did not add code logic to judge the projects table. Whether the same id already exists in .

There is already data in the table about projects、models....

"1. create dir 
mkdir -p /root/pgml-bak
2.pgml.dump_all
SELECT pgml.dump_all('/root/pgml-bak');
3. drop 
drop extension pgml;
4. create 
create extension pgml; 
5. check projects
select * from pgml.projects;"

"1. pgml.load_all
select pgml.load_all('/root/pgml-bak');

"1.select pgml.load_dataset('diabetes');
select pgml.train(
    project_name => 'Diabetes Regression new',
    task => 'regression',
    relation_name => 'pgml.diabetes',
    y_column_name  => 'target',
    algorithm=> 'kernel_ridge'
);"

INFO:  Snapshotting table "pgml.diabetes", this may take a little while...
ERROR:  duplicate key value violates unique constraint "projects_pkey"
LINE 1: SELECT COUNT(*) FROM information_schema.tables WHERE table_n...
               ^
QUERY:  SELECT COUNT(*) FROM information_schema.tables WHERE table_name = $1 AND table_schema = $2
Time: 32.945 ms

Is the result of my usage considered a bug?

@montanalow
Copy link
Contributor

I believe you would be better served with:

ALTER EXTENSION pgml UPDATE;

Dropping the extension drops all trained models, because those tables are owned by the extension.

@frg01
Copy link
Author

frg01 commented Jan 6, 2024

I believe you would be better served with:

ALTER EXTENSION pgml UPDATE;

Dropping the extension drops all trained models, because those tables are owned by the extension.

Okay, thanks, so the application scenario of pgml backup and recovery applies to extension upgrades. Is my understanding correct?

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