Connection options: PG searchPath error

Wappler Version : 5.2.6
Server Model: NodeJS
Database Type: PG

In the db config file a searchPath key is being added with an empty string in an array. This is causing issues with pg.

"searchPath": [
      ""
    ]

I am assuming this was added a few versions ago when schema db support was added. It seems you can’t have an empty string there as the parser will throw an error.

"status": "500",
    "code": "42601",
    "message": "zero-length delimited identifier at or near \"\"\"\"",
    "stack": "error: zero-length delimited identifier at or near \"\"\"\"\n    at Parser.parseErrorMessage (/Users/jon/Documents/dev/hadrian_grin/node_modules/pg-protocol/dist/parser.js:287:98)\n    at Parser.handlePacket (/Users/jon/Documents/dev/hadrian_grin/node_modules/pg-protocol/dist/parser.js:126:29)\n    at Parser.parse (/Users/jon/Documents/dev/hadrian_grin/node_modules/pg-protocol/dist/parser.js:39:38)\n    at Socket.<anonymous> (/Users/jon/Documents/dev/hadrian_grin/node_modules/pg-protocol/dist/index.js:11:42)\n    at Socket.emit (node:events:390:28)\n    at addChunk (node:internal/streams/readable:315:12)\n    at readableAddChunk (node:internal/streams/readable:289:9)\n    at Socket.Readable.push (node:internal/streams/readable:228:10)\n    at TCP.onStreamRead (node:internal/stream_base_commons:199:23)"
}

If not using a specific schema and defaulting to public it should be [“public”] or the key-value shouldn’t be added at all.

Yes seems there is an error setting it when empty as it should be left out.

Was reported in:

Thanks for confirming. I wasn’t able to find it in the search as it was unlisted.

sorry about it - will be solved in the net update.

Fixed in Wappler 5.3.0

1 Like

This topic was automatically closed after 24 hours. New replies are no longer allowed.

@JonL
Can you explain what is wrong there again?

The searchPath key was copied from the connection file in ./wappler to /app so the db connection failed.

well if you just re-edit the global database connection settings for that target - the new ones will be saved in the right target folder and used.