# Dremio and Underlying info schemas for Postgres

**URL:** https://community.dremio.com/t/dremio-and-underlying-info-schemas-for-postgres/3808
**Category:** Uncategorized
**Created:** [August 4, 2019, 1:35am UTC](https://community.dremio.com/t/dremio-and-underlying-info-schemas-for-postgres/3808 "2019-08-04T01:35:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ben\_Spencer](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@Ben\_Spencer](https://community.dremio.com/u/Ben_Spencer)
#### Post date: [August 4, 2019, 1:35am UTC](https://community.dremio.com/t/dremio-and-underlying-info-schemas-for-postgres/3808/1 "2019-08-04T01:35:31Z")

</div>

Hi, I want to query the underlying information\_schema for my postgres database(s). This doesnt work diretly as Dremio doesn’t actually list the information\_schema. All good, makes sense but I created a “pgschema” database and then created a view “v\_pg\_tables” on the underlying “information\_schema.tables” table. Once Dremio refreshed the source I got the listing for the view but on trying to run a query I get “Selected Table has no columns”?

Build : 3.2.8-201907180222520740-08f2b54  
Edition : Community Edition

Restarted Dremio but it didnt help.

Any suggestions

---

<div class="post-metadata">

### Author: ![Ben\_Spencer](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@Ben\_Spencer](https://community.dremio.com/u/Ben_Spencer)
#### Post date: [August 4, 2019, 2:19am UTC](https://community.dremio.com/t/dremio-and-underlying-info-schemas-for-postgres/3808/2 "2019-08-04T02:19:58Z")

</div>

This is very odd indeed. FYI I am using the same account in pgadmin and dremio . I have now created another view as below … this works fine in pgadmin but only brings back the desciption column filled with the table\_schema contents. I suspect that the other column names are reserved in Dremio for some reason? alias is next

SELECT c.table\_schema,  
c.table\_name,  
c.column\_name,  
pgd.description  
FROM pg\_statio\_all\_tables st  
JOIN pg\_description pgd ON pgd.objoid = st.relid  
JOIN information\_schema.columns c ON pgd.objsubid = c.ordinal\_position::integer AND c.table\_schema::name = st.schemaname AND c.table\_name::name = st.relname;

---

<div class="post-metadata">

### Author: ![Ben\_Spencer](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@Ben\_Spencer](https://community.dremio.com/u/Ben_Spencer)
#### Post date: [August 4, 2019, 5:55am UTC](https://community.dremio.com/t/dremio-and-underlying-info-schemas-for-postgres/3808/3 "2019-08-04T05:55:57Z")

</div>

Ok, so Aliasing the column names didn’t work either. Any help would be great. Looks like it has something to do with the information\_schema though

---

<div class="post-metadata">

### Author: ![Ben\_Spencer](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@Ben\_Spencer](https://community.dremio.com/u/Ben_Spencer)
#### Post date: [August 4, 2019, 6:17am UTC](https://community.dremio.com/t/dremio-and-underlying-info-schemas-for-postgres/3808/4 "2019-08-04T06:17:27Z")

</div>

Also created a materialised view in Posgtres. MV’s dont seem to show up either.

---

<div class="post-metadata">

### Author: ![Ben\_Spencer](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@Ben\_Spencer](https://community.dremio.com/u/Ben_Spencer)
#### Post date: [August 7, 2019, 3:04pm UTC](https://community.dremio.com/t/dremio-and-underlying-info-schemas-for-postgres/3808/5 "2019-08-07T15:04:31Z")

</div>

No response at all on this team Dremio? I thought that the issue would raise some quality eyebrows especially where the wrong data is being displayed in the wrong column in some instances.

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [August 8, 2019, 3:16am UTC](https://community.dremio.com/t/dremio-and-underlying-info-schemas-for-postgres/3808/6 "2019-08-08T03:16:36Z")

</div>

@Ben_Spencer

Kindly provide us the profile for the first failure

Thanks  
@balaji.ramaswamy
