Can anyone confirm the flaw of postgres and how to deal with it?

Started by Shaozhong SHIalmost 4 years ago3 messagesgeneral
Jump to latest
#1Shaozhong SHI
shishaozhong@gmail.com

I loaded several tables onto Postgres.

When you view, you can see all columns.

However, there are 'ghost columns' that I remember I used before, but not
now.

select column_name::text from information_schema.columns where
table_name=a_table

keeps listing columns that I can not see in the current table.

Why does this happen?

What is the solution?

Regards,

David

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Shaozhong SHI (#1)
Re: Can anyone confirm the flaw of postgres and how to deal with it?

On Wed, Apr 20, 2022 at 8:48 AM Shaozhong SHI <shishaozhong@gmail.com>
wrote:

I loaded several tables onto Postgres.

When you view, you can see all columns.

However, there are 'ghost columns' that I remember I used before, but not
now.

select column_name::text from information_schema.columns where
table_name=a_table

keeps listing columns that I can not see in the current table.

Why does this happen?

What is the solution?

I'm going to assume some kind of operator error until you can prove the
observation with actual queries and output. Hopefully putting that
information together will cause you to realize where you are wrong. If not
we at least get something that is debuggable.

David J.

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Shaozhong SHI (#1)
Re: Can anyone confirm the flaw of postgres and how to deal with it?

On 4/20/22 08:47, Shaozhong SHI wrote:

I loaded several tables onto Postgres.

When you view, you can see all columns.

However, there are 'ghost columns' that I remember I used before, but
not now.

 select column_name::text from information_schema.columns where
table_name=a_table

Best guess is that since you are not filtering on table_schema you are
seeing columns for tables with table_name=a_table across all schemas.

keeps listing columns that I can not see in the current table.

Why does this happen?

What is the solution?

Regards,

David

--
Adrian Klaver
adrian.klaver@aklaver.com