Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider relkind also when filtering relations #208

Merged
merged 3 commits into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/storage/postgres_table_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SELECT pg_namespace.oid AS namespace_id, relname, NULL relpages, NULL attname, N
FROM pg_class
JOIN pg_namespace ON relnamespace = pg_namespace.oid
JOIN pg_constraint ON (pg_class.oid=pg_constraint.conrelid)
WHERE contype IN ('p', 'u') ${CONDITION}
WHERE relkind IN ('r', 'v', 'm', 'f', 'p') AND contype IN ('p', 'u') ${CONDITION}
ORDER BY namespace_id, relname, attnum, constraint_id;
)";
string condition;
Expand Down Expand Up @@ -98,6 +98,9 @@ void PostgresTableSet::AddConstraint(PostgresResult &result, idx_t row, Postgres
vector<string> columns;
for (auto &split : splits) {
auto index = std::stoull(split);
if (index <= 0 || index > create_info.columns.LogicalColumnCount()) {
return;
}
columns.push_back(create_info.columns.GetColumn(LogicalIndex(index - 1)).Name());
}

Expand Down
Loading