How To Parse Json In A Stored Procedure In Postgresql

Say we have a table called person with the following structure --------------------------- column| datatype --------------------------- _id | autonumber name | text age | integer --------------------------- We want to insert multiple records into the table using a stored procedure. If we have a stored procedure with say two input variables name and age, then it will take multiple calls. We can do this using a single call if we use a json input and using the json_to_recordset function.

Three Tier Architecture in Docker

In this article I am going to talk about how to do a classic 3-tier architecture using docker containers. The 3-tiers will be: Frontend tier: This will host the web application. Middle tier: This will host the api, in our case the REST api. Database tier: This will host the database. We want to expose the web application to the outside world. Simultaneously, we want this layer to be able to talk with the middle tier only not the database tier.

Upgrading Postgresql to V11

I run two instances of postgres servers - one on my local machine and the other one on my do virtual machine. Both of them are on debian. One of them was running 10.x and the other one 9.x version of postgres. I wanted to upgrade them to the latest version - that is version 11. I was pleasantly surprised to see how simple it was. This is what I did:

Nokia Camera App Is Talking With Facebook

So I have a Nokia 7 Plus and I thought it would be better than the Chinese ones as far as data protection and privacy is concerned. I was completely wrong. I recently installed NoRoot Firewall and I found a lot of apps which I thought did not need any internet connection or backend actually connecting to some servers somewhere. Phone, Message, every single google app calls home. I was most surprised to see even the Nokia camera app connecting to facebook and I don’t even use facebook.

Creating an OTP Screen in Flutter

Nowadays, one time password (OTP) is used a lot as an authentication mechanism. Sometimes the OTP is sent using SMS and sometimes its sent through email. A screen for users to input the OTP has to be created. In this article we will talk about creating a simple screen in flutter to allow users to enter the OTP. Suggested laptop for programming Lenovo IdeaPad S145 AMD Ryzen 5 15.6" FHD Thin and Light Laptop (8GB/512GB SSD/Windows10/Office/Platinum Grey/1.

Writing a Postgresql Stored Procedure Returning a Single Value

Say we have a table called person with the following structure --------------------------- column| datatype --------------------------- _id | autonumber name | text age | integer --------------------------- We want to write a stored procedure to return the highest age that we have in the table. We will use OUT param here. CREATE OR REPLACE FUNCTION get_max_age(OUT max_age int) RETURNS int LANGUAGE 'plpgsql' AS $BODY$ BEGIN SELECT MAX(age) INTO max_age FROM person; END $BODY$; That’s it.

Writing a Postgresql Stored Procedure Returning Resultset

Coming from Microsoft SQL Server, I keep on forgetting how to return a resultset from a stored procedure in postgresql. Here is a small sample of how to do it. Needs a bit more code than SQL Server. Note that postgresql does not have stored procedure, they have function. They are equivalent. Say we have a table called person with the following structure --------------------------- column| datatype --------------------------- _id | autonumber name | text age | integer --------------------------- We want to write a stored procedure to return records with age greater than a specified age.

Login Flow in Flutter

In this article, I will be showing a simple flutter app that will demonstrate a typical mobile login flow. This article is not an introductory tutorial on flutter or programming. I am assuming that the reader knows programming and has basic understanding of how flutter works. You can find more from flutter.io. Suggested laptop for programming Lenovo IdeaPad S145 AMD Ryzen 5 15.6" FHD Thin and Light Laptop (8GB/512GB SSD/Windows10/Office/Platinum Grey/1.

Chrome is the new IE 6

I am getting increasingly frustrated with chrome. Or should I say developers. It seems the developers never bother to test their apps in anything other than chrome now. Granted that chrome has 65% of the marketshare, but developers must and should build for standards but it seems they are building only for chrome. But how did they get to here? Yes, by pesking users to download chrome whenever users get to one of google’s properties.