Skip to content

Differences with SHOW TABLE [table name] vs SHOW [table name] and nullability of fields. #13950

@rustyconover

Description

@rustyconover

What happens?

When describing a table with a field that can be null the output of SHOW TABLE and SHOW differ in regards to nullability. SHOW TABLE doesn't show the field as nullable, SHOW does.

I believe they should be consistent.

I've written an example below for a table that has a single column that cannot be null.

To Reproduce

create table example(name text not null);
-- will show as nullable
show table example;
┌─────────────┬─────────────┬─────────┬─────────┬─────────┬─────────┐
│ column_name │ column_type │  null   │   key   │ default │  extra  │
│   varchar   │   varchar   │ varchar │ varchar │ varchar │ varchar │
├─────────────┼─────────────┼─────────┼─────────┼─────────┼─────────┤
│ name        │ VARCHAR     │ YES     │         │         │         │
└─────────────┴─────────────┴─────────┴─────────┴─────────┴─────────┘
-- will not show as nullable
show example;
┌─────────────┬─────────────┬─────────┬─────────┬─────────┬─────────┐
│ column_name │ column_type │  null   │   key   │ default │  extra  │
│   varchar   │   varchar   │ varchar │ varchar │ varchar │ varchar │
├─────────────┼─────────────┼─────────┼─────────┼─────────┼─────────┤
│ name        │ VARCHAR     │ NO      │         │         │         │
└─────────────┴─────────────┴─────────┴─────────┴─────────┴─────────┘

OS:

Mac OS X

DuckDB Version:

1.1.0

DuckDB Client:

CLI

Hardware:

No response

Full Name:

Rusty Conover

Affiliation:

self

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?

No - Other reason (please specify in the issue body)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions