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...
United States
Great Britain
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Singapore
Hungary
Ukraine
Luxembourg
Estonia
Lithuania
South Korea
Turkey
Switzerland
Colombia
Taiwan
Chile
Norway
Ecuador
Indonesia
New Zealand
Cyprus
Denmark
Finland
Poland
Malta
Czechia
Austria
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Netherlands
Bulgaria
Latvia
South Africa
Malaysia
Japan
Slovakia
Philippines
Mexico
Thailand