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 three 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
A quick summary of this page would be that PostgreSQL makes writing SQL both a bit simpler, and also a bit more powerful.
Here are 3 specific ways in which PostgreSQL makes it easier to work with data types. The first is that PostgreSQL stores all text in Unicode format, so you don't have this T-SQL dilemma (although to be fair to SQL Server, varchar fields have allowed Unicode characters since SQL Server 2019, which I must admit I hadn't realised):
T-SQL field type | What it means |
|---|---|
nvarchar(n) | A column holding up to n Unicode characters |
varchar(n) | A column holding up to n normal text characters |
With PostgreSQL there is only varchar. However PostgreSQL also makes life easier is by recommending nice, simple data types:
Data type | Holds |
|---|---|
text | Strings of text |
integer | Whole numbers |
numeric | Any other numbers |
And a third way in which PostgreSQL tries to make your life easier is by having a defined boolean data type, instead of the messy T-SQL bit:

The still_active column has boolean data type, which doesn't exist in SSMS.
Postgres also has a wider range of data types than SQL for more niche uses.
It's not a huge difference, but PostgreSQL definitely gives more power to your querying elbow. To use one example, it includes a useful split_part function:
split_part ( String of text, Delimiter to use, Number of item to extract )
So for example you could pick out the 3rd word in a list much more easily in PostreSQL than in T-SQL:

This would be much harder to do in Transact SQL.
Postgres does far more (useful) implicit conversions of data types, to avoid you having to do this explicitly. To give one example, consider this query to concatenate text and numbers together:

Postgres automatically converts the run time minutes into text before concatenating it.
By contrast, here's the equivalent query in SSMS:

The equivalent query in SSMS gives an error.
To get the SSMS query to work you'd have to convert the number to text (or use the CONCAT function, which also exists in PostgreSQL):
-- show film title and length
SELECT
f.title + ' (' +
CAST(f.run_time_minutes AS varchar(max))
+ ' minutes)'
FROM
film AS f
There are lots of cases where Postgres converts data types automatically for you when SSMS won't.
Postgres is much better for wildcards. Firstly, it contains the useful ilike to relax case sensitivity:

This query wouldn't return any rows if you changed ilike to like.
It is possible to manage case sensitivity in SSMS, but it is much less straightforward!
Postgres also allows you to use regular expressions:

The ^ operator allows matching to a regular expression.
And on top of all this, Postgres has the alternative SIMILAR TO syntax:

This would show films beginning with either Shrek or Rush Hour, for example.
Out of the above differences, it's the keyword ilike which will make life easier for the average SQL user.
PostgresSQL includes a concept of the interval between two specific dates using time intelligence:

The difference above is showing as an interval (a specific period of time between two specific dates).
This leads to the inclusion of an age function:

At this point SSMS SQL users might like to pause to wipe the tears of frustration from their keyboards ...
I think all of the above examples show that the ethos of PostgreSQL is more towards making things slightly less techie, and slightly easier to use.
| 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.