0001-sql-don-t-use-IF-NOT-EXISTS-when-creating-materializ.patch
wcs/sql.py | ||
---|---|---|
1632 | 1632 |
def create_materialized_view_if_not_exists(conn, cur): |
1633 | 1633 |
if get_publisher().pg_version < 94000: |
1634 | 1634 |
return |
1635 |
cur.execute('''CREATE MATERIALIZED VIEW IF NOT EXISTS wcs_materialized_all_forms |
|
1635 |
try: |
|
1636 |
cur.execute('''CREATE MATERIALIZED VIEW wcs_materialized_all_forms |
|
1636 | 1637 |
AS SELECT * from wcs_all_forms''') |
1638 |
conn.commit() |
|
1639 |
except psycopg2.ProgrammingError: |
|
1640 |
conn.rollback() |
|
1637 | 1641 | |
1638 | 1642 |
@guard_postgres |
1639 | 1643 |
def refresh_materialized_views(): |
1640 |
- |