#endif
+ -- Add geometry column
+
EXECUTE ''ALTER TABLE '' ||
#if USE_VERSION >= 73
quote_ident(real_schema) || ''.'' || quote_ident(table_name)
|| '' ADD COLUMN '' || quote_ident(column_name) ||
'' geometry '';
+
+ -- Delete stale record in geometry_column (if any)
+
+ EXECUTE ''DELETE FROM geometry_columns WHERE
+ f_table_catalog = '' || quote_literal('''') ||
+ '' AND f_table_schema = '' ||
+#if USE_VERSION >= 73
+ quote_literal(real_schema) ||
+#else
+ quote_literal('''') ||
+#endif
+ '' AND f_table_name = '' || quote_literal(table_name) ||
+ '' AND f_geometry_column = '' || quote_literal(column_name);
+
+
+ -- Add record in geometry_column
+
EXECUTE ''INSERT INTO geometry_columns VALUES ('' ||
quote_literal('''') || '','' ||
#if USE_VERSION >= 73
new_dim || '','' || new_srid || '','' ||
quote_literal(new_type) || '')'';
+ -- Add table checks
+
EXECUTE ''ALTER TABLE '' ||
#if USE_VERSION >= 73
quote_ident(real_schema) || ''.'' || quote_ident(table_name)