This commit is contained in:
Colas Geier 2024-08-20 19:19:51 +02:00
parent 079c675dc6
commit 631e1b479f

View File

@ -429,7 +429,7 @@ def check_proprio(schema='38_202207',con=con_fon):
def _insert_proprio(schema='38_202207'):
sql = '''set work_mem='512MB';
INSERT INTO cadastre.proprios
SELECT DISTINCT
SELECT DISTINCT
ccodep||dnuper dnuper,
ccoqua::integer,
btrim(ddenom) AS ddenom,
@ -722,7 +722,7 @@ def update_typprop(con=con_fon):
sql = '''set work_mem='512MB';
UPDATE
cadastre.parcelles
SET typprop_id = coalesce(gtoper::text,'_'||ccogrm::text)
SET typprop_id = nullif(concat_ws('_',gtoper::text,ccogrm::text),'')
FROM cadastre.proprios
JOIN cadastre.r_prop_cptprop USING (dnuper)
JOIN cadastre.cptprop USING (dnupro)
@ -741,10 +741,10 @@ if __name__ == "__main__":
from pycen import update_to_sql
# par = '3805050000E0523'
par = None
sch = '38_202307'
sch = '38_202407'
drop_tables(con_fon)
lst_sch = ['07_202307','26_202307','42_202307','38_202307']
lst_sch = ['07_202407','26_202407','42_202407','38_202407']
for sch in lst_sch:
print(' INIT ',sch)
insert_voie(sch)