Registry / database / node-red-contrib-storagemodule-postgres

node-red-contrib-storagemodule-postgres

JSON →
library1.0.1jsnpmunverified

A storage module for Node-RED that replaces the default filesystem-based persistence with a PostgreSQL database. Version 1.0.1 is the current stable release, maintained by WeekendWarrior1. It creates two tables (`nodered` and `noderedlibrary`) to store flows, credentials, and settings. It supports optional schema configuration and auto-install of modules on start-up. Designed for production deployments requiring centralized state, disaster recovery, and team collaboration. Older than alternatives like `node-red-contrib-storage-s3`, it has limited feature coverage (no sessions or projects) and relies on the Node-RED Storage API.

npm install node-red-contrib-storagemodule-postgres
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-S
N
node-red-contrib-storagemodule-postgres
databasejavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

storageModule
const storageModule = require('node-red-contrib-storagemodule-postgres')
import storageModule from 'node-red-contrib-storagemodule-postgres'
CommonJS require is the standard for Node-RED settings.js. ES module imports are not supported.
postgresURI
postgresURI: 'postgres://user:pass@host:5432/db'
postgresURI: 'postgresql://user:pass@host:5432/db'
Use 'postgres://' scheme; 'postgresql://' may not be recognized.
postgresSchema
postgresSchema: 'custom_schema'
postgresSchema: 'public'
Default is 'public' if omitted; no need to specify unless using a different schema.
autoInstallModules
autoInstallModules: true
autoInstallModules: false
Set to true to reinstall modules after a restart; false disables this feature.
userDir
userDir: '/home/user/.node-red/'
userDir: '/home/user/.node-red'
Trailing slash is required for palette manager to work properly.

Configures Node-RED to use PostgreSQL for flow persistence instead of filesystem. Sets the storage module, database URI, optional schema, auto-install, and userDir.

// In your Node-RED settings.js (usually ~/.node-red/settings.js) module.exports = { // ... other settings ... storageModule: require('node-red-contrib-storagemodule-postgres'), postgresURI: process.env.POSTGRES_URI ?? 'postgres://user:pass@localhost:5432/nodered', postgresSchema: 'public', // optional, defaults to public autoInstallModules: true, // optional userDir: __dirname + '/', // required for palette management };
Debug
Known issues
gotchaSessions and projects are not implemented; session data and project-related storage will fall back to filesystem or fail silently.
fix
Use an alternative storage module if you need session or project support.
affects: >=0.0.0
gotchaErrors are printed to console, not thrown, making debugging harder in headless environments.
fix
Monitor logs carefully or contribute a fix to throw errors.
affects: >=0.0.0
gotchaThe module does not properly log activity; only prints errors to stdout.
fix
Set up logging externally or wrap the module.
affects: >=0.0.0
breakingpostgresURI must use 'postgres://' scheme, not 'postgresql://'.
fix
Ensure URI starts with 'postgres://'.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'node-red-contrib-storagemodule-postgres'
Module not installed in Node-RED user directory.
fix
Run 'npm install node-red-contrib-storagemodule-postgres' in the .node-red folder.
error: relation "nodered" does not exist
Tables not created automatically; module requires write permissions.
fix
Ensure the PostgreSQL user has CREATE TABLE privileges and that the tables are created on startup.
ECONNREFUSED - connection refused
PostgreSQL server not accessible or incorrect host/port.
fix
Verify postgresURI and network connectivity; ensure PostgreSQL is running.
error: password authentication failed for user
Incorrect credentials in postgresURI.
fix
Update postgresURI with valid username and password.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
node-red-contrib-storagemodule-postgres — npm install node-red-contrib-storagemodule-postgres · libregistry