KNIME Database SQL Filter using the IN Operator

Sometimes using KNIME it would be nice to create a DB row filter based on a list of items. When not using DB tools you can use the reference row filter but this cannot be used with DB connections. The other standard method would be to use the DB Row Filter but this only supports …

IoT Sensors – Saving Collected Data

Now that my sensors are successfully collecting data and the data is being processed by a Node-RED flow on my Raspberry Pi the final step is to add some persistence to the data. As it stands the data is constantly streaming and being displayed on a dashboard but after that it’s discarded so there’s no …

Getting Database and Table Sizes in Postgres

Total Database Size This SQL simply gets the total size of the database in a human readable format. SELECT pg_size_pretty(pg_database_size(‘postgres’)) as db_size List all Tables This lists all the tables in the database public schema. SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = ‘public’ Search Schema for Column Name I often need to search all the …

Looking Up Offset Rows in PostgreSQL

A common task when either reporting or doing data analysis is to extract data from a database table or view and then lookup corresponding values from either previous or next rows. A good example of this was a recent KPI report I made for E-commerce where the KPI depended not only on the total daily …