Table 和同名的复合类型 select 问题

Table and composite type with same name select problem

我有一个与 table 同名的复合数据类型。当我从 table 中使用与复合类型同名的 select 时,postgres 显示一条错误消息“是复合类型”。我不能从 table select。我该怎么做才能告诉 postgres 我是 selecting 来自 table 而不是复合数据类型?

A table 和复合类型不能有相同的名称,除非它们在不同的模式中,因为它们共享一个名称 space(索引、视图和序列共享相同的名称space).

由于类型和 table 必须在不同的架构中,您可以通过使用架构名称限定它来引用 table:schema_name.table_name