{"id":45576,"library":"node-red-contrib-re-postgres","title":"Node-RED PostgreSQL Query Node","description":"A Node-RED node for querying PostgreSQL databases. Version 0.3.7 is current and maintained, with moderate release cadence. It replaces the original node by Kris Daniels to ensure compatibility with latest Node-RED versions. Key differentiator: supports template-based queries using msg.queryParameters with $propertyName substitution, and offers row-by-row output via 'One message per row' option. Allows connection string configuration.","status":"active","version":"0.3.7","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","node-red","postgres","postgresql"],"install":[{"cmd":"npm install node-red-contrib-re-postgres","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-re-postgres","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-re-postgres","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency: Node-RED must be installed","package":"node-red","optional":false},{"reason":"Required for PostgreSQL client functionality","package":"pg","optional":false}],"imports":[{"note":"This is a Node-RED node, not a library to import via require/import. Use npm install and configure in Node-RED flows.","wrong":"Attempting to import as JavaScript module directrly (e.g., require('node-red-contrib-re-postgres'))","symbol":"node-red-contrib-re-postgres","correct":"Install as a Node-RED node via npm. No import in code; configure in Node-RED UI."}],"quickstart":{"code":"// Node-RED flow JSON example\n[\n  {\n    \"id\": \"n1\",\n    \"type\": \"inject\",\n    \"z\": \"flow1\",\n    \"name\": \"\",\n    \"props\": [{\"p\": \"payload\"}, {\"p\": \"queryParameters\", \"v\": {\"type\": \"json\", \"json\": \"{\\\"id\\\": 1, \\\"name\\\": \\\"test\\\"}\"}}],\n    \"repeat\": \"\",\n    \"crontab\": \"\",\n    \"once\": false,\n    \"onceDelay\": 0.1,\n    \"topic\": \"\",\n    \"payload\": \"SELECT * FROM users WHERE id = $id AND name = $name\",\n    \"payloadType\": \"str\"\n  },\n  {\n    \"id\": \"n2\",\n    \"type\": \"postgres\",\n    \"z\": \"flow1\",\n    \"name\": \"\",\n    \"config\": \"postgres config\",\n    \"x\": 400,\n    \"y\": 200,\n    \"wires\": [[\"n3\"]]\n  },\n  {\n    \"id\": \"n3\",\n    \"type\": \"debug\",\n    \"z\": \"flow1\",\n    \"name\": \"\",\n    \"active\": true,\n    \"tosidebar\": true,\n    \"console\": false,\n    \"tostatus\": false,\n    \"complete\": \"payload\",\n    \"targetType\": \"msg\"\n  },\n  {\n    \"id\": \"postgres config\",\n    \"type\": \"postgres-config\",\n    \"name\": \"My DB\",\n    \"connectionString\": \"postgresql://user:password@localhost:5432/mydb\",\n    \"z\": \"flow1\"\n  }\n]","lang":"javascript","description":"Creates a Node-RED flow with inject node providing query parameters, PostgreSQL node executing the query, and debug showing result."},"warnings":[{"fix":"Ensure msg.queryParameters is a flat object. Use dot notation? Not supported; use $propertyName only.","message":"msg.queryParameters must be an object with string keys; nested objects may not work","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use $propertyName syntax; do not use $1, $2.","message":"Query template uses $propertyName, not $1, $2 placeholders – users may expect positional parameters","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Uninstall the original node if using this one.","message":"Original node (node-red-node-postgres) may still be installed side by side, causing confusion","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.3.7':17 'allow':68 'base':48 'cadenc':25 'compat':36 'configur':71 'connect':69 'current':19 'daniel':33 'databas':15 'differenti':44 'ensur':35 'javascript':72 'key':43 'kris':32 'latest':38 'maintain':21 'messag':64 'moder':23 'msg.queryparameters':51 'node':2,6,9,11,30,40,74 'node-r':1,8,39,73 'offer':56 'one':63 'option':67 'origin':29 'output':61 'per':65 'postgr':76 'postgresql':4,14,77 'propertynam':53 'queri':5,13,49 'red':3,10,41,75 'releas':24 'replac':27 'row':58,60,66 'row-by-row':57 'string':70 'substitut':54 'support':45 'templat':47 'template-bas':46 'use':50 'version':16,42 'via':62","created_at":"2026-06-07T12:55:41.628138+00:00","updated_at":"2026-06-07T12:55:41.628138+00:00","problems":[{"fix":"Run 'npm install pg' in your Node-RED directory.","cause":"Missing PostgreSQL client dependency","error":"Error: Cannot find module 'pg'"},{"fix":"Ensure PostgreSQL is running and connection string is correct.","cause":"PostgreSQL server not running or connection string wrong","error":"Error: connect ECONNREFUSED 127.0.0.1:5432"},{"fix":"Check table name and schema; use schema.table format.","cause":"Table name misspelled or schema not public","error":"msg.error: relation \"table\" does not exist"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"node-red-contrib-re-postgres","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}