duckdb / duckdb/duckdb-postgres

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

Open
#269 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
372
Forks
105
Avg merge
10h 19m
Merged PRs (30d)
18

Description

### 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.