Now that we have this procedure we probably want to test it, just like we test our other code. Next to testing whether your SQL is in order, you can also test whether your schema is in order (does table product exist and does it have a price column, for example). This is something that is completely different from MongoDB as it did not have a schema. Testing databases can be a bit difficult. You need test data, maybe, inserted with some seed function, maybe, already present. You do not want to mess up your test data by making changes in your application. You probably need to set up database connections and transactions. It can be a hassle. However, there are some tools that make it a bit easier. pgTap is one of those tools. Using pgTap, you can write a test script in SQL, run it in a console, and output your data in TAP format (Test Anything Protocol, https...
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia