SQL translator › T-SQL → PostgreSQL
SQL Server to PostgreSQL translator
Postgres wants LIMIT and ||. CONVERT(style) has no twin — use to_char.
Usual swaps
| SQL Server | SQL Server |
|---|---|
| TOP n | LIMIT n |
| ISNULL | COALESCE |
| GETDATE() | now() |
| DATEADD(unit, n, d) | d + interval |
| CONCAT / + | || or CONCAT |
| CONVERT(varchar, d, 23) | to_char(d, 'YYYY-MM-DD') |
| STRING_AGG | string_agg |
| [brackets] | "quotes" or lowercase |
| IDENTITY | GENERATED … AS IDENTITY |
BIT is boolean. nvarchar is text. OFFSET FETCH already looks like Postgres.
Then write it on a ticket
Monday is free. A colleague asks, you type, we mark it.
Clock in free