Skip to content

[Postgresql] Export returns empty when schema name is not added to table name in query #17178

@adeifeadekunbi

Description

@adeifeadekunbi

Provide the Bytebase version you are using

3.6.0

Describe the bug

When running a query in Bytebase without explicitly including the schema name before the table in PostgreSQL, it will return the query result but the export function returns an empty file. However, if the schema name is included in the query, the export works correctly and returns the expected data.

Steps to reproduce

Without Schema name added to table

  1. Write a query without adding schema name to the table.
  2. Run the query
  3. Returns query result
  4. Click on Export button to export to CSV. Empty result will be exported.
    With Schema name added to table
  5. Write a query adding schema name to the table.
  6. Run the query
  7. Returns query result
  8. Click on Export button to export to CSV. Query result will be exported.

Expected behavior

Export should return the query results even if the schema name is omitted, as long as the query runs successfully in the UI.

Provide the database you are using

Postgresql 16

Additional context

This behavior appears to be PostgreSQL-specific and may be related to how the export function handles default schema resolution.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions