|
4 | 4 | #include "duckdb/parser/constraints/foreign_key_constraint.hpp" |
5 | 5 | #include "duckdb/parser/statement/create_statement.hpp" |
6 | 6 | #include "duckpgq/common.hpp" |
7 | | -#include <duckpgq/core/functions/table.hpp> |
8 | | -#include <duckpgq/core/utils/duckpgq_utils.hpp> |
| 7 | +#include "duckpgq/core/functions/table.hpp" |
| 8 | +#include "duckpgq/core/utils/duckpgq_utils.hpp" |
9 | 9 | #include "duckdb/main/connection_manager.hpp" |
10 | | -#include <duckpgq/core/parser/duckpgq_parser.hpp> |
| 10 | +#include "duckpgq/core/parser/duckpgq_parser.hpp" |
11 | 11 | #include "duckdb/catalog/catalog.hpp" |
12 | 12 |
|
13 | 13 | namespace duckdb { |
@@ -187,10 +187,11 @@ unique_ptr<FunctionData> CreatePropertyGraphFunction::CreatePropertyGraphBind(Cl |
187 | 187 | CheckPropertyGraphTableColumns(vertex_table, table); |
188 | 188 | CheckPropertyGraphTableLabels(vertex_table, table); |
189 | 189 | } catch (CatalogException &e) { |
190 | | - auto table = |
191 | | - Catalog::GetEntry<ViewCatalogEntry>(context, vertex_table->catalog_name, vertex_table->schema_name, |
192 | | - vertex_table->table_name, OnEntryNotFound::RETURN_NULL); |
193 | | - if (table) { |
| 190 | + EntryLookupInfo view_info(CatalogType::VIEW_ENTRY, vertex_table->table_name, QueryErrorContext()); |
| 191 | + |
| 192 | + auto entry = Catalog::GetEntry(context, vertex_table->catalog_name, vertex_table->schema_name, view_info, |
| 193 | + OnEntryNotFound::RETURN_NULL); |
| 194 | + if (entry) { |
194 | 195 | throw Exception(ExceptionType::INVALID, "Found a view with name " + vertex_table->table_name + |
195 | 196 | ". Creating property graph tables over views is " |
196 | 197 | "currently not supported."); |
@@ -247,13 +248,16 @@ unique_ptr<FunctionData> CreatePropertyGraphFunction::CreatePropertyGraphBind(Cl |
247 | 248 | // Validate primary keys in the destination table |
248 | 249 | ValidatePrimaryKeyInTable(context, edge_table->destination_pg_table, edge_table->destination_pk); |
249 | 250 | } catch (CatalogException &e) { |
250 | | - auto table = Catalog::GetEntry<ViewCatalogEntry>(context, edge_table->catalog_name, edge_table->schema_name, |
251 | | - edge_table->table_name, OnEntryNotFound::RETURN_NULL); |
252 | | - if (table) { |
| 251 | + EntryLookupInfo view_info(CatalogType::VIEW_ENTRY, edge_table->table_name, QueryErrorContext()); |
| 252 | + |
| 253 | + auto entry = Catalog::GetEntry(context, edge_table->catalog_name, edge_table->schema_name, view_info, |
| 254 | + OnEntryNotFound::RETURN_NULL); |
| 255 | + if (entry) { |
253 | 256 | throw Exception(ExceptionType::INVALID, "Found a view with name " + edge_table->table_name + |
254 | 257 | ". Creating property graph tables over views is " |
255 | 258 | "currently not supported."); |
256 | 259 | } |
| 260 | + |
257 | 261 | throw Exception(ExceptionType::INVALID, e.what()); |
258 | 262 | } catch (BinderException &e) { |
259 | 263 | throw Exception(ExceptionType::INVALID, "Catalog '" + edge_table->catalog_name + "' does not exist!"); |
|
0 commit comments