uWSGI, Flask, sqlalchemy, and postgres: SSL error: decryption failed or bad record mac

The issue ended up being uwsgi’s forking. When working with multiple processes with a master process, uwsgi initializes the application in the master process and then copies the application over to each worker process. The problem is if you open a database connection when initializing your application, you then have multiple processes sharing the same … Read more

How can I start PostgreSQL on Windows?

Go inside bin folder in C drive where Postgres is installed. run following command in git bash or Command prompt: pg_ctl.exe restart -D “<path upto data>” Ex: pg_ctl.exe restart -D “C:\Program Files\PostgreSQL\9.6\data” Another way: type “services.msc” in run popup(windows + R). This will show all services running Select Postgres service from list and click on … Read more

postgresql – replace all instances of a string within text field

You want to use postgresql’s replace function: replace(string text, from text, to text) for instance : UPDATE <table> SET <field> = replace(<field>, ‘cat’, ‘dog’) Be aware, though, that this will be a string-to-string replacement, so ‘category’ will become ‘dogegory’. the regexp_replace function may help you define a stricter match pattern for what you want to … Read more