Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
BMG PUBLIC RESOURCES
SIG-TOPO-BMG
Commits
31c8bd25
Commit
31c8bd25
authored
Jan 31, 2021
by
Alice Salsé
Browse files
👌
duplicate attribute
parent
e62e599a
Changes
1
Hide whitespace changes
Inline
Side-by-side
sql/network/function_duplicate_attributes.sql
View file @
31c8bd25
...
...
@@ -9,10 +9,11 @@ RETURNS void AS $BODY$
DECLARE
_relations
CURSOR
FOR
select
*
from
utils
.
vm_related_table
where
foreign
_table
=
i_nw_regclass
::
text
;
where
primary
_table
=
i_nw_regclass
::
text
;
_new_obj
jsonb
;
BEGIN
-- ==== Select foreign table from primary table ===
RAISE
INFO
'DUPLICATE ATTRIBUTE %'
,
i_nw_regclass
;
FOR
r
in
_relations
LOOP
EXECUTE
FORMAT
(
'SELECT jsonb_strip_nulls(row_to_json(a.*)::jsonb) FROM %1$s a
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment