Hacker Newsnew | past | comments | ask | show | jobs | submit | approachingtraj's commentslogin

This is so fucking stupid.


> stuff json into a text column

You did see the article was about JSONB, which is significantly more sophisticated than "json in a text column", yes?


Yes, the person I was replying to was asking about what to do if you don't have jsonb.


The title is misleading. The post only talks about Amazon's RDS which is not Postgres.


Amazon RDS is the managed version of Postgres (among other flavors of relational DBs). Maybe you are confusing it with Redshift.

https://aws.amazon.com/rds/


Isn't Redshift also based on PostgreSQL? Edit: it is: https://en.wikipedia.org/wiki/Amazon_Redshift and RDS supports many different RDBMS flavors: https://en.wikipedia.org/wiki/Amazon_Relational_Database_Ser...


Redshift is based on PestgreSQL, but is vastly different. Redshift is a columnar store, and can't do things like create indexes. http://docs.aws.amazon.com/redshift/latest/dg/c_SQL_commands...


> Instead of resorting to those hacks, follow the PostgreSQL documentation[1] to do it the right way. The simplest way is to initialize your PostgreSQL database cluster as:

This is actually poor advice. The right way on Ubuntu is to use the packages provided by PostgreSQL Development Group (https://wiki.postgresql.org/wiki/Apt), and in that setup you use pg_createcluster instead of initdb.

The snippet in the original article was so hacky because it fixed an existing cluster instead of destroying it and creating a new one in UTF-8.


> This is actually poor advice. The right way on Ubuntu is to use the packages provided by PostgreSQL Development Group (https://wiki.postgresql.org/wiki/Apt), and in that setup you use pg_createcluster instead of initdb.

initdb is part of standard PostgreSQL utilities/tools[1] for initializing your PostgreSQL server that's why I suggested using it. On the other hand, I don't see any reference to pg_createcluster command in the official PostgreSQL documentation. So I don't know why you think using a non-standard PostgreSQL tool (in place of a standard one i.e. initdb) is the right way of initializing a PostgreSQL database cluster.

[1] https://www.postgresql.org/docs/9.5/static/reference-server....


Since we're talking about Ubuntu, I would use the Ubuntu tools. They make it very easy to maintain several Postgres clusters side-by-side, e.g. /var/lib/postgresql/9.4/main vs /var/lib/postgresql/9.5/main. You can also control which binaries you use with the PGCLUSTER variable, like this:

    PGCLUSTER=9.4/main pg_dump foo
    PGCLUSTER=9.5/main pg_dump foo


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: