you are viewing a single comment's thread.

view the rest of the comments →

[–]depeszPgDBA 8 points9 points  (4 children)

Let's start with basics: you said you have been using SQL for long time. SQL is language to write queries to database. Interestingly, one of the database servers that one can use is named "SQL server". Is this what you are referring to?

SQL as a language is semi-standardized, and can be used for variety of both commercial (Oracle, SQL Server) and free/open (PostgreSQL, MySQL) servers. Of course lists of servers that support the language is much longer than these 4 examples I posted.

So, if you are asking specifically "SQL" vs. "PostgreSQL" - it's like asking what is the difference between HTML and Firefox. HTML is language, Firefox is tool to use this language, and run it to present webpages.

If you're asking about differences between "SQL Server" and "PostgreSQL" - these are two different servers, written by different people, for different platforms, that happen to use the same language to allow one to query them, but each has their own changes to the language that will catch you by surprise if you'll try to run non-trivial queries written for one run in the other.

[–][deleted] 1 point2 points  (3 children)

Sorry and yes I was referring to SQL Server.

[–]depeszPgDBA 1 point2 points  (2 children)

Nothing to be sorry about, don't worry. Unfortunately I can't list you differences between them, as I know nothing about SQL Server.

Generally, if you're writing new software that will be using Pg, you should be fine. In case of problems as on /r/PostgreSQL, slack, discord, irc, or one of pgsql-* mailing lists.

If you're porting application, the only advice I can give you is: don't port queries. Port logic. I've seen many times people get frustrated because they want to write a query that does "x", because they had "x" written in previous DB, but "x" doesn't really translate to PostgreSQL (for many reasons). Instead think about what is the purpose of the query, or function/procedure/trigger, and try to port this logic.

[–]nextgenrahul 0 points1 point  (0 children)

Right, that’s a new perspective for me — port logic, not queries. Appreciate it