Web developers who made the switch from MySQL, what functions of postgresql could you do without?

I am considering a switch (mainly because of a more permissive license), and as a rule, I hear a lot of online murmurs about how much better Postgres is than MySQL, but not so many features. What are you doing at Postgres that makes you more productive, or do you consider elegant?

This should not be a fantasy, for example, some of my favorite things about MySQL include

  • easy primary key incrementing with AUTOINCREMENT (the need to write a generator for each table seems more painful than it should be for such a general requirement),
  • "LIMIT, OFFSET" (simplifies paging)
  • ON DUPLICATE KEY UPDATE (makes adding / updating many-many tables quick and painless)
+5
source share
5 answers

PostgreSQLThe most useful features (which MySQLare missing), in my opinion, are as follows:

  • generate_series and set return functions in general
  • the ability to use correlated values ​​in sentences LIMITandOFFSET
  • Custom Aggregates
  • DISTINCT ON
  • More advanced techniques JOIN( MERGE JOINand HASH JOIN)

You can do miracles with them.

PostgreSQL ( , "look" "" ), (::), RECORD .

:

  • ( , , , , )
  • ( custom_variable_classes)
  • DISTINCT GROUP BY .

, ( ).

SQL .

+4
  • Transactional DDL - "start transaction; delete table foo; rollback;" foo .
+3

PostgreSQL PostGIS . , Google ( ) .

0
  • /UDF Perl
  • libpq
  • , ,
  • GIN GIST
0

. :

CREATE TABLE "FILES" (
    ...
    md5checksum text NOT NULL,
    CONSTRAINT "FILES_md5checksum_check" CHECK ((md5checksum ~* '^[a-f0-9]{32}$'::text)),
    ...
);

md5checksum , 32 .

0

All Articles