News for hackers. Stuff that matters.
Re:Distinct on: a confusing, unique and useful feature in Po... by cosmotic on Friday March 20, 2020 @05:04PM (#22641645)
If you want your application to be portable, don't use this feature.
Re:Distinct on: a confusing, unique and useful feature in Po... by _jal on Friday March 20, 2020 @06:20PM (#22642263)
This advice grew out of the days when database platforms cost enormous amounts of money. It is still as true as it ever was, but since then the biggest pressure that lead to it no longer applies.

Back before PG and others were viable competitors to the big commercial databases, about the only leverage customers had against aggressive sales people was the threat to switch to a competitor. So people would preserve that as a credible threat by not using proprietary SQL extensions.

No vampiric salesdroid from Postgres is going to knock on your door demanding 8 figures.

Now, there may be other reasons you want to switch away from it, or you may want to support a variety of DBs in whatever you're building, or some other reason. So it is good to be aware of. But shying away from SQL extensions is usually no longer a matter of budgetary apocalypse.

Re:Distinct on: a confusing, unique and useful feature in Po... by irrational on Friday March 20, 2020 @05:08PM (#22641678)
Do you mean portable as in able to run on different databases? Your application would have to be fairly simple to achieve that goal. We moved an application from Oracle to Postgres. It took about 2 years to complete.
Re:Distinct on: a confusing, unique and useful feature in Po... by cosmotic on Monday March 23, 2020 @07:24PM (#22669992)
Many applications are built on ORMs which are pretty portable. About the only thing I regularly depend on that is proprietary per RDBMS is "last insert autoincrement id" since it's not part of the SQL standard. Binary blobs is another big one.
Re:Distinct on: a confusing, unique and useful feature in Po... by cosmotic on Monday March 23, 2020 @07:22PM (#22669974)
If you start out minimizing proprietary features, its a lot easier to do. Oracle is filled with proprietary features so I'm not surprised it was a lot of work. My application is pretty simple and I converted from mysql to postgres in an afternoon.
Re:Distinct on: a confusing, unique and useful feature in Po... by munk-a on Friday March 20, 2020 @07:05PM (#22642641)
At my first job I worked on a program that supported MySQL, MSSQL and Postgres[1]. Now I work on a project that's Postgres only and, honestly, I don't see the need to put any effort into SQL neutrality these days.

1. Only because I hacked it in during my free-time since it is such a trivial dialect to support.

Re:Distinct on: a confusing, unique and useful feature in Po... by notatoad on Saturday March 21, 2020 @01:24AM (#22644700)
is anybody out there actually writing portable sql?
Re:Distinct on: a confusing, unique and useful feature in Po... by cosmotic on Monday March 23, 2020 @07:25PM (#22669996)
I am. Also anyone else using an ORM likely is.