Skip to content

Conversation

JanCaha
Copy link
Contributor

@JanCaha JanCaha commented Sep 19, 2025

Description

Update QgsPostgresUtils functions columnExists() and tableExists() with schema parameter, so that they can be used to search for colums and tables outside of public schema.

This is intended for future updates and work.

@github-actions github-actions bot added this to the 4.0.0 milestone Sep 19, 2025
Copy link
Contributor

github-actions bot commented Sep 19, 2025

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit c5dd489)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This installer is not signed, control+click > open the app to avoid the warning
(Built from commit c5dd489)

void QgsPostgresProvider::setEditorWidgets()
{
if ( !QgsPostgresUtils::tableExists( connectionRO(), EDITOR_WIDGET_STYLES_TABLE ) )
if ( !QgsPostgresUtils::tableExists( connectionRO(), QStringLiteral( "public" ), EDITOR_WIDGET_STYLES_TABLE ) )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's potentially a regression here -- the existing code supports these tables being placed in a default schema which is NOT "public". I think the tableExists/columnExists methods should support empty string for schema to use the current logic, which doesn't check the schema.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I did not realize that. Should be fixed as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants