Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
435 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
|
A detailed comparison of PostgreSQL and Microsoft's T-SQL for SSMS Part four of a four-part series of blogs |
|---|
|
Even though Microsoft's SQL Server Management Studio and PostgreSQL use the same underying language (SQL), the user interface and dialects are quite different at times, as this blog explains.
|
In this blog
You can decide for yourself for each of the differences listed below (in no particular order) which of the approaches you prefer!
Compare the T-SQL method:

Joining two colums together in T-SQL.
With the PosgreSQL method:

The same thing using the || characters in PostgreSQL.
if you want to get just the first N rows from a query, the syntax is different between the two dialects:

A T-SQL (left) versus PostgreSQL (right) query to list the 5 oldest directors.
With the introduction of the FORMAT function into T-SQL, this now has a slightly easier way to format dates, but Postgres gets Brownie points for allowing you to show 1st, 2nd, 3rd, etc.

The T-SQL way on the left, the PostgreSQL one on the right.
Postgres doesn't have either of these functions:
Function | Use instead |
|---|---|
IIF | CASE ... WHEN ... END |
ISNULL | COALESCE |
In neither case is this a particular problem, as the alternative methods are just as good!
Many functions in PostgreSQL are different to their T-SQL equivalents. Here are a few examples:
Task | T-SQL | PostgreSQL |
|---|---|---|
Find one string within another | CHARINDEX('Owl','Wise Owl') | POSITION('Owl' in 'Wise Owl') |
Get the length of a string of text | LEN('Wise Owl') | LENGTH('Wise Owl') |
Getting today's date | GETDATE() | CURRENT_DATE |
Casting data types | CAST(42 AS varchar(10)) | CAST(42 AS text), but also 42::text |
As a general rule, I'd say that the PostgreSQL functions are a bit more intuitive to use, and there tend to be slightly more of them.
I've limited myself in this blog to changes to do with basic selection queries. The more you delve into programming (scripting views, writing functions and stored procedures, declaring variables, etc) the bigger the differences between PostgreSQL and T-SQL become.
| Parts of this blog |
|---|
|
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2026. All Rights Reserved.