# Acceed Heroku postgresql db

**URL:** <https://discourse.nodered.org/t/acceed-heroku-postgresql-db/63272>\
**Category:** General\
**Tags:** database\
**Created:** [30 May 2022 21:22 UTC](https://discourse.nodered.org/t/acceed-heroku-postgresql-db/63272 "2022-05-30T21:22:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Otabiel](https://avatars.discourse-cdn.com/v4/letter/o/91b2a8/32.png) [@Otabiel](https://discourse.nodered.org/u/Otabiel)\
**Post date:** [30 May 2022 21:22 UTC](https://discourse.nodered.org/t/acceed-heroku-postgresql-db/63272/1 "2022-05-30T21:22:48Z")

</div>

Hi community, I am using node-red v2.2.2 and node.js v14.19.3.

I making a small project, and I'm trying to acceed my data stored on an Heroku postgres app.  
My environnement of work is a web site using Next.js and prisma for create and managed the db and heroku for hosting the db.

I've installed node-red-contrib-postgresql and have configure the db connection as my url : user:password@host:port/db.

The issue is that when i'm simply trying to make the request `SELECT * FROM user;` it return me the name of the user used for the db connection and not the data present in my table named User.

Here is my prisma schema

```auto
datasource db {
  provider = "postgresql"
  url = env("DATABASE_URL")
  shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

model User {
  id String @id @default(uuid())
  email String @unique
  name String?
  password String?
  sensors Sensor[]
}

model Sensor {
  id String @id @default(uuid())
  owner User @relation(fields: [ownerId], references: [id])
  ownerId String // relation scalar field (used in the `@relation` attribute above)
  dev_id String
  nitrate Int
  phos Int
  potass Int
  co2 Int
  temp Int
  humidity Int
}

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [31 May 2022 00:25 UTC](https://discourse.nodered.org/t/acceed-heroku-postgresql-db/63272/2 "2022-05-31T00:25:13Z")

</div>

Hi, welcome to the forum.

Are you able to use another tool to access the database directly? If so, can you run exactly the same query using that tool to see what results you get?

I don't really know Postgress or Horuku but I wonder whether there is a different table in that database that has a similar name? For example, is the table name case-sensitive such that `user` and `User` are different tables?

---

<div class="post-metadata">

**Author:** ![Otabiel](https://avatars.discourse-cdn.com/v4/letter/o/91b2a8/32.png) [@Otabiel](https://discourse.nodered.org/u/Otabiel)\
**Post date:** [31 May 2022 08:16 UTC](https://discourse.nodered.org/t/acceed-heroku-postgresql-db/63272/3 "2022-05-31T08:16:38Z")

</div>

Hi, thanks for your quick answer !

I've installed beekeeper studio and connect to my db. The connection seems to be good, my two table apear :  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/1377ae50dd280a836f5d3bfe15775e0b8d7a7cb2.png)

But again when I try to do `SELECT * FROM User` the return of the query is not my User stored in it but again my user used to connect to the db..

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fafc1003353fd7c9570b87eae092d6754f911087.png)

Do I have maybe to add something in front of the name table ?

And I tried the case sensitivity but it's seems to be not case sensitive. I've wrote User or user and nothing change..

---

<div class="post-metadata">

**Author:** ![Otabiel](https://avatars.discourse-cdn.com/v4/letter/o/91b2a8/32.png) [@Otabiel](https://discourse.nodered.org/u/Otabiel)\
**Post date:** [31 May 2022 08:19 UTC](https://discourse.nodered.org/t/acceed-heroku-postgresql-db/63272/4 "2022-05-31T08:19:11Z")

</div>

OK ! I've found the issue, I just needed to write the name of my table in quote like : `SELECT * FROM "User"` and it returns me the right thing...

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [31 May 2022 08:27 UTC](https://discourse.nodered.org/t/acceed-heroku-postgresql-db/63272/5 "2022-05-31T08:27:09Z")

</div>

So I was right 😸

You may want to consider renaming your `User` to `nr_user` or something else to save yourself future confusion. 😀

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 June 2022 08:27 UTC](https://discourse.nodered.org/t/acceed-heroku-postgresql-db/63272/6 "2022-06-14T08:27:53Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
