bug fix pg no raster_columnes views

This commit is contained in:
Tom LAVEILLE 2025-07-29 10:17:45 +02:00
parent d4b181ff61
commit c02da75f0b

View File

@ -231,12 +231,20 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
cur.execute(custom_list) cur.execute(custom_list)
list_schema = cur.fetchall() list_schema = cur.fetchall()
SQLraster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """ SQLcountRaster = """SELECT schemaname,viewname FROM pg_catalog.pg_views
cur.execute(SQLraster) WHERE schemaname LIKE 'public' AND viewname LIKE 'raster_columns';"""
list_raster = cur.fetchall() cur.execute(SQLcountRaster)
RasterList = [] RasterIF = len(cur.fetchall())
for rasterFind in list_raster:
RasterList.append(rasterFind[0]) if RasterIF == 1:
SQLloadRaster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """
cur.execute(SQLloadRaster)
list_raster = cur.fetchall()
RasterList = []
for rasterFind in list_raster:
RasterList.append(rasterFind[0])
else:
RasterList = []
self.tableWidget.setRowCount(len(list_schema)) self.tableWidget.setRowCount(len(list_schema))
self.tableWidget.setColumnCount(4) self.tableWidget.setColumnCount(4)
@ -374,8 +382,8 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
# def displayOnWindows(type, uri, name): # def displayOnWindows(type, uri, name):
# p = [] # p = []
SQLraster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """ SQLloadRaster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """
cur.execute(SQLraster) cur.execute(SQLloadRaster)
list_raster = cur.fetchall() list_raster = cur.fetchall()
RasterList = [] RasterList = []
for rasterFind in list_raster: for rasterFind in list_raster: