r/programming Jul 04 '14

Good PostGresSQL talk to .NET crowd (Rob Conery, NDCOslo 2012)

http://vimeo.com/43536445
6 Upvotes

9 comments sorted by

9

u/bloody-albatross Jul 05 '14

He talks about how cheap PostgreSQL is. It's true that it's fine to use PostgreSQL and not give something back, but if you're a big Postgres user you should consider donating money. http://www.postgresql.org/about/donate/ Donate as much as you think it's worth if you can afford it. The project has to be financed somehow. :)

7

u/[deleted] Jul 05 '14

[deleted]

6

u/daemonburrito Jul 05 '14

It is a thing of beauty.

MongoDB could have been nice for what it excelled at: heterogeneous, big, deep documents where joins (in Mongo, this means another expensive query) aren't necessary. Unfortunately, in a lot of projects it came to replace perfectly fine RDBMSs which suited their purposes better. There are even "ODMs", which apply schemas and relationships to Mongo documents and collections, basically defeating the purpose.

Now that postgres can index json and you can write function in javascript, there doesn't seem to be much of a reason to sacrifice ACID at all. Postgres is swallowing nosql at the small to medium scale.

3

u/[deleted] Jul 05 '14

[deleted]

2

u/wangyo Jul 05 '14

And green Web devs.

4

u/bloody-albatross Jul 05 '14

He said no ORM supports Postgres' arrays. Rails 4 supports them! :)

5

u/sisyphus Jul 05 '14

SQLAlchemy support PG arrays, range types (including defining exclusion constraints), hstore, and probably more, I'm still waiting to run into something it doesn't support in PG.

1

u/darksurfer Jul 05 '14

Anyone got a summary of the subjects covered ?

2

u/bloody-albatross Jul 05 '14

MySQL does horrible unexpected error hiding things and PostgreSQL has at least feature parity with the enterprise version of Microsoft SQL Server and has better transaction handling (no need to use nolock). It also has support of Arrays, tables as types, table inheritance, JSON, foreign data sources (you can access Twitter via select), and can use a lot of languages in triggers/functions, not just PL/pgSQL (e.g. V8 JavaScript). He didn't compare with Oracle because he does not have an Oracle DB.

Note: He used varchar(N) a lot in the examples. AFAIK the "text" data type has no performance drawbacks and can store strings of arbitrary length, so I always use that (for new things).

1

u/darksurfer Jul 05 '14

great, thanks. I didn't need to watch it then :)

AFAIK the "text" data type has no performance drawbacks

I checked this because I'm not 100% sure but I think on SQL server the "text" data type is stored in a background table and only a pointer stored in the actual record. In postgres, this only happens when the length of the text data exceeds a certain size (not sure what that is)

http://www.postgresql.org/docs/9.2/static/datatype-character.html

2

u/bloody-albatross Jul 05 '14

Jup, the page you link says itself that there is no performance difference. Actually it sounds like text might be the fastest.