Postgres vs MS SQL Server #82
Replies: 16 comments
-
Throws error if a string value would be truncated |
Beta Was this translation helpful? Give feedback.
-
Supports easy durations as strings |
Beta Was this translation helpful? Give feedback.
-
Everything is just UTF8. |
Beta Was this translation helpful? Give feedback.
-
Everything is case sensitive |
Beta Was this translation helpful? Give feedback.
-
Support for regex, match, like |
Beta Was this translation helpful? Give feedback.
-
True is a value, Boolean is a data type |
Beta Was this translation helpful? Give feedback.
-
DISTINCT FROM |
Beta Was this translation helpful? Give feedback.
-
Bit arrays |
Beta Was this translation helpful? Give feedback.
-
Array data types |
Beta Was this translation helpful? Give feedback.
-
JSON data type |
Beta Was this translation helpful? Give feedback.
-
Array literals |
Beta Was this translation helpful? Give feedback.
-
Supports slices |
Beta Was this translation helpful? Give feedback.
-
The "~" operator to match to regex strings. |
Beta Was this translation helpful? Give feedback.
-
SELECT * FROM file_extensions fe WHERE file_extension ~ '[.+!#-]'; |
Beta Was this translation helpful? Give feedback.
-
The boolean type. UPDATE files SET file_name_broken_cant_change_ro = TRUE WHERE file_id = 38873; BIT is an interesting type in SQL Server, but not the same. That and it's not aggreble. |
Beta Was this translation helpful? Give feedback.
-
PostgreSQL allows function overloading; that is, the same name can be used for several different functions so long as they have distinct argument types. I don't think MS SQL Server supports this, even in SQLCLR. So I'm creating a function, RTRIM(string, int), that trims off n characters from the right. Why? I created a table that had columns like "amountleft" and "amountleft_original", updated by a MERGE command. To generate the following SQL: WHEN MATCHED THEN
UPDATE SET
amountleft_original = tgt.amountleft,
amountleft = src.amountleft and not miss any columns I can use the following: SELECT RTRIM(column_name, LENGTH('_original')) AS column_name FROM information_schema.COLUMNS WHERE table_name = 'torrents' AND table_schema = 'simplified' AND column_name LIKE '%original'; I know this is anathema to people I've worked with, like Jamie or crap Simplot people "why not just cut and paste??", but, hey, I have a brain. |
Beta Was this translation helpful? Give feedback.
-
Enumerated types
Beta Was this translation helpful? Give feedback.
All reactions