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

allow raw on conflict statement #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

maglnet
Copy link

@maglnet maglnet commented Dec 14, 2022

Signed-off-by: Matthias Glaub maglnet@users.noreply.github.com

I had the case where I needed to merge jsonb values done within the ON CONFLICT clause.
e.g.:

ON CONFLICT (time, location) UPDATE SET data = original.data::jsonb || excluded.data::jsonb

With the provided PR this is now possible as follows:

 CALL decompress_backfill(
                staging_table=>'temp_staging',
                destination_hypertable=> 'original',
                on_conflict_action=>  'UPDATE_RAW',
                on_conflict_target=> '(time, location)',
                on_conflict_update_columns=> ARRAY['data = original.data || excluded.data::jsonb']
            );

Signed-off-by: Matthias Glaub <maglnet@users.noreply.github.com>
@CLAassistant
Copy link

CLAassistant commented Dec 14, 2022

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Matthias Glaub <maglnet@users.noreply.github.com>
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.

2 participants