# "500 Failed to retrieve records" error using PostgreSQL

**URL:** <https://community.dreamfactory.com/t/500-failed-to-retrieve-records-error-using-postgresql/5264>\
**Category:** Connecting to SQL\
**Created:** [December 23, 2020, 4:16am UTC](https://community.dreamfactory.com/t/500-failed-to-retrieve-records-error-using-postgresql/5264 "2020-12-23T04:16:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akaHeimdall](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/akaheimdall/32/1329_2.png) [@akaHeimdall](https://community.dreamfactory.com/u/akaHeimdall)\
**Post date:** [December 23, 2020, 4:16am UTC](https://community.dreamfactory.com/t/500-failed-to-retrieve-records-error-using-postgresql/5264/1 "2020-12-23T04:16:01Z")

</div>

I’ve configured the service, app, and roles for my endpoint. I can successfully run API calls on /schema, /function, /table - basically all the single nodes that don’t have a table name.

When I do add a table name (e.g., /table/myTableName) I receive a 500 error:

```
{
  "error": {
    "code": 500,
    "context": null,
    "message": "Failed to retrieve records from 'getresidents'.\nSQLSTATE[42703]: Undefined column: 7 ERROR: column d.adsrc does not exist\nLINE 1: ...ER(format_type(a.atttypid, a.atttypmod)) AS type, d.adsrc, a...\n ^ (SQL: SELECT a.attname, LOWER(format_type(a.atttypid, a.atttypmod)) AS type, d.adsrc, a.attnotnull, a.atthasdef,\n\tpg_catalog.col_description(a.attrelid, a.attnum) AS comment\nFROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum\nWHERE a.attnum &gt; 0 AND NOT a.attisdropped\n\tAND a.attrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table\n\t\tAND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = :schema))\nORDER BY a.attnum)",
    "status_code": 500
  }
}

```

This even occurs when running from the API Docs inside of the DreamFactory app.

Are there any specific permissions I need to have on the user? I’m even trying with the default postgres user and am getting this error.

I could really use help from anyone who can offer assistance. Thanks.

---

<div class="post-metadata">

**Author:** ![akaHeimdall](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/akaheimdall/32/1329_2.png) [@akaHeimdall](https://community.dreamfactory.com/u/akaHeimdall)\
**Post date:** [February 16, 2021, 6:59pm UTC](https://community.dreamfactory.com/t/500-failed-to-retrieve-records-error-using-postgresql/5264/2 "2021-02-16T18:59:38Z")

</div>

I’ve learned that if you update the schema in your database in any manner (add or remove columns from a table or view, etc.), you’ll need to got to “Services” \> Name of your service \> “Config” and select the “Save and Clear Cache” in order to see the new columns.
