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

When querying information_schema.tables, even if the data source is a view, it is displayed as BASE TABLE. #269

Open
2 tasks
cobolbaby opened this issue Oct 17, 2024 · 0 comments

Comments

@cobolbaby
Copy link

What happens?

When querying information_schema.tables, even if the data source is a view, it is displayed as BASE TABLE.

To Reproduce

$ ./duckdb 
v1.1.2 f680b7d08f
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D ATTACH 'dbname=bdc_test user=... password=... host=... port=...' AS bdc_test (TYPE POSTGRES, READ_ONLY, SCHEMA 'dw');
D show all tables;
┌──────────┬─────────┬──────────────────────┬──────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────┐
│ database │ schema  │         name         │     column_names     │                                                       column_types                                                        │ temporary │
│ varchar  │ varchar │       varchar        │      varchar[]       │                                                         varchar[]                                                         │  boolean  │
├──────────┼─────────┼──────────────────────┼──────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────┤
│    ·     │ ·       │       ·              │          ·           │                                                             ·                                                             │   ·       │
│ bdc_test │ dw      │ view_dim_pca_model   │ [company, family, …  │ [VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, INTEGER, VARCHAR, VARCHAR, INTEGER, V…  │ false     │
│ bdc_test │ dw      │ view_model_line      │ [id, model, line, …  │ [INTEGER, VARCHAR, VARCHAR, VARCHAR, VARCHAR, VARCHAR, TIMESTAMP, TIMESTAMP, VARCHAR]                                     │ false     │
│    ·     │ ·       │       ·              │          ·           │                                                             ·                                                             │   ·       │
├──────────┴─────────┴──────────────────────┴──────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────┤
│ 63 rows (40 shown)                                                                                                                                                                             6 columns │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
D SELECT * FROM information_schema.tables WHERE table_schema='dw' and table_name like 'view_%';
┌───────────────┬──────────────┬──────────────────────┬────────────┬──────────────────────┬───┬──────────────────────┬────────────────────┬──────────┬───────────────┬───────────────┐
│ table_catalog │ table_schema │      table_name      │ table_type │ self_referencing_c…  │ … │ user_defined_type_…  │ is_insertable_into │ is_typed │ commit_action │ TABLE_COMMENT │
│    varchar    │   varchar    │       varchar        │  varchar   │       varchar        │   │       varchar        │      varchar       │ varchar  │    varchar    │    varchar    │
├───────────────┼──────────────┼──────────────────────┼────────────┼──────────────────────┼───┼──────────────────────┼────────────────────┼──────────┼───────────────┼───────────────┤
│    ·     │ ·       │       ·              │          ·           │                                                             ·                                                             │   ·       │
│ bdc_test      │ dw           │ view_dm_line         │ BASE TABLE │                      │ … │                      │ YES                │ NO       │               │               │
│ bdc_test      │ dw           │ view_dim_pca_model   │ BASE TABLE │                      │ … │                      │ YES                │ NO       │               │               │
│    ·     │ ·       │       ·              │          ·           │                                                             ·                                                             │   ·       │
├───────────────┴──────────────┴──────────────────────┴────────────┴──────────────────────┴───┴──────────────────────┴────────────────────┴──────────┴───────────────┴───────────────┤
│ 9 rows                                                                                                                                                       13 columns (10 shown) │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘



OS:

x86_64

DuckDB Version:

1.1.2

DuckDB Client:

Python

Hardware:

No response

Full Name:

Cobol

Affiliation:

Inventec

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have
@szarnyasg szarnyasg transferred this issue from duckdb/duckdb Oct 17, 2024
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

No branches or pull requests

1 participant