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

Some tips #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Some tips #4

wants to merge 1 commit into from

Conversation

aipog
Copy link

@aipog aipog commented Nov 25, 2021

Dear all,
thanks for the guide, very usefull. I added three ideas:

In create schema, I've added --createImportTabs useful for tracing import operations.
added a new chapter: replace
removed the constraint reference in datenintegration with the amt.t_id key. If you use the replace option with ili2pg the operation fail with constraint error.
I hope this is usefull.

Regards
Giosia

/cc @vvmruder @vuilleumierc @michmuel

Dear all,
thanks for the guide, very usefull. I added three ideas:

In create schema, I've added --createImportTabs useful for tracing import operations.
added a new chapter: replace
removed the constraint reference in datenintegration with the amt.t_id key. If you use the replace option with ili2pg the operation fail with constraint error.
I hope this is usefull.

Regards
Giosia
@vvmruder
Copy link
Contributor

Having a part describing the replace sounds nice. However I'm not really aware if this is a use case in real production world.

@aipog
Copy link
Author

aipog commented Nov 25, 2021

Our business side want check daily the federal data and replace it in the db.

@vvmruder
Copy link
Contributor

No offense :) I can imagine there are use cases. Only wanted to do a statement that my review expertise it not about this :)

@aipog
Copy link
Author

aipog commented Nov 25, 2021

No worries. Have a nice evening

@michmuel
Copy link
Collaborator

Thanks for the input. I think this documentation should describe which ili2pg- and SQL-commands are required to create the tables and its columns in order that the theme is accessible by pyramid_oereb. As I see, there are also some ili2pg-options that have no effect related to pyramid_oereb and can be used or not. Probably, the setting of creation and maintaining such a DB is different from canton to canton.

Adding a "replacement" section is certainly helpful. I would probably keep the foreign key constraint in the table "datenintegration" as it shows the relation to the office table. But of course you can remove it in your application.

@aipog
Copy link
Author

aipog commented Nov 26, 2021

Hi, yes of course. Feel free to implement or not. Imho, the relation is useless because the load process is done programmatically and if you use a replace ili2pg procedure generate problems. You could delete the row before insert but if ili2pg didn't end correctly you have to rollback or do something to reinsert the correct row in "datenintegration".

@@ -42,6 +42,7 @@ java -jar $ili2pg --schemaimport \
--createMetaInfo \ # creates additional tables with information from the interlis model
--createNumChecks \ # creates constraints for numerical data types
--createUnique \ # creates unique constraints in the db for Interlis unique constraints
--createImportTabs \ # creates import tables for trace import operations
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put this option under "Options that might be relevant dependent on individual settings"

@@ -121,11 +142,7 @@ CREATE TABLE IF NOT EXISTS :schema.datenintegration
datum timestamp without time zone NOT NULL,
amt bigint NOT NULL,
checksum character varying COLLATE pg_catalog."default",
CONSTRAINT datenintegration_pkey PRIMARY KEY (t_id),
CONSTRAINT datenintegration_amt_fkey FOREIGN KEY (amt)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing this, I would suggest to add a comment that the constraint "datenintegration_amt_fkey" might raise conflicts if a dataset is replaced by ili2pg and, therefore, a user has to decide if he wants to ommit it.

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

Successfully merging this pull request may close these issues.

3 participants