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

Bug: Chat2DB does not display PgSQL partitioned table #1163

Open
Jimokk opened this issue Feb 11, 2024 · 0 comments
Open

Bug: Chat2DB does not display PgSQL partitioned table #1163

Jimokk opened this issue Feb 11, 2024 · 0 comments

Comments

@Jimokk
Copy link

Jimokk commented Feb 11, 2024

Chat2DB Version

3.1.15

Describe the bug

Preface

Years ago, when I used PGSQL to create a table, I found that the table could not be displayed. When the problem recurred today, it was said that the problem was located in the partition table.

Problem Description

The partition table I created is not displayed, but the partitions can be displayed. For example, if I create a partition table called tb_test, this table will not be displayed (refreshing is useless), and then I create a partition for this table such as tb_test_0/ 1/2/3, these partitions can be displayed normally.

Problem recurrence

  1. The following is the SQL code (PgSQL) that I executed when reproducing:
DROP TABLE IF EXISTS public.tb_test;
CREATE TABLE public.tb_test (
	id bigserial NOT NULL,
	tx_date varchar(8) NOT NULL,
	CONSTRAINT PK_tb_test_ID PRIMARY KEY (id, tx_date) -- Added a primary key constraint using ID and tx_date
)
PARTITION BY LIST (tx_date);  --Partition LIST, RANGE, LIST is used here
  1. You can also check the contents of the table by executing SELECT
SELECT * FROM public.tb_test;

At the same time, if you try to create a new table without deleting it, an error will be reported. You can be sure that the table does exist.

  1. At this time, refresh the Schema named plat in Chat2DB and view it as empty. The screenshot is as follows:

image

But you can see this table in DBeaver, the screenshot is as follows:

image

  1. If I create a partition named tb_test_0/1/2/3 for the table at this time, it will be displayed normally, but it will not be displayed in DBeaver. The relevant statements and screenshots are as follows:
CREATE TABLE plat.tb_test_0 PARTITION OF plat.tb_test FOR VALUES IN ('20240110');

(Since it is just a test, only three partitions are created here, where the constant in plat.tb_test_%d is equal to the last digit of the date).

image

image

Summarize

The above is the specific description of this BUG. In fact, I am not sure whether this is a BUG or whether Chat2DB is deliberately set up like this. However, in my work scenario, the relevant partitions of this table are automatically created every day, that is It said that after I created all the work tables, the partition table was not displayed, which was a bit inconvenient and strange to use.

Thank you again to all developers for your hard work and reading! Happy New Year to everyone! Good luck in the Year of the Dragon!

@Jimokk Jimokk added the bug Something isn't working label Feb 11, 2024
openai0229 pushed a commit to openai0229/Chat2DB that referenced this issue Feb 20, 2024
openai0229 pushed a commit to openai0229/Chat2DB that referenced this issue Feb 21, 2024
openai0229 added a commit to openai0229/Chat2DB that referenced this issue Feb 26, 2024
@miahemu miahemu changed the title Bug: Chat2DB不显示PgSQL的分区表 Bug: Chat2DB does not display PgSQL partitioned table Feb 28, 2024
@miahemu miahemu added Postgresql-bug and removed bug Something isn't working labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants