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

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

From
Shaozhong SHI
Date:
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

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

From
"David G. Johnston"
Date:
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.

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

From
Adrian Klaver
Date:
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