7 ms·
As of 9.5, Postgres JSONB data can be modified
- thewhitetulip 11y agoI have read so much about postgres as a database, but sadly I have never been able to actually download install and use it, have read many tutorials but unfortunately it isn't as simple as installing mysql
- Illniyar 11y agoWindows has an msi that also installs pgadmin and sets it up as a service, nothing could be simpler
- stadeschuldt 11y agoWhat is your system? Installing it on OSX is super easy. Either using Homebrew or http://postgresapp.com http://postgresapp.com
- thewhitetulip 11y agoElementary OS
- jimktrains2 11y agoIt is as simple, it's just not the same. It's also in most distro and bsd repos. For the benefits of PostgreSQL over MySQL it is definitely worth learning.
- jaddison 11y agoI can only assume that you are not using any mainstream *nix-based operating system. Installing through package management is easy for both MySQL and PostgreSQL.
- TylerE 11y agoThere are easy one-or-two-click installers for Windows and Mac OS X as well.
- thewhitetulip 11y agoI am using elementary OS and I have installed it many times, can you give me a good tutorial about installing and configuring postgres? I want to use it with golang for development of webapps. I am not trolling here btw, I am really stuck with sqlite because of inability of installing postgrest :(
- simoncion 11y agoI mean, with Gentoo Linux I had to do the following things: * If I wanted to make Postgres listen on non-localhost, modify listen_addresses in postgresql.conf. * Add database access controls as required in pg_hba.conf. The comments in the file are illuminating, but one can examine [0] for more information. [1] * Create a database with appropriate permissions, along with a user. [2] * Start Postgres. I remember having to do the equivalent of all of those things every time I had to install MySQL. :) What -exactly- did you successfully do, what -exactly- did you fail to do? Divulging that information will help guide assistance efforts. :) [0] http://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.html http://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.h... [1] For example, the following line would allow password-based access from IPv4 localhost by the user "user" to the database "database": host database user 127.0.0.1/32 md5 [2] http://www.postgresql.org/docs/9.4/static/sql-createdatabase.html http://www.postgresql.org/docs/9.4/static/sql-createdatabase... for CREATE DATABASE syntax (or you can use createdb http://www.postgresql.org/docs/9.4/static/app-createdb.html http://www.postgresql.org/docs/9.4/static/app-createdb.html ) http://www.postgresql.org/docs/9.4/static/sql-createrole.html http://www.postgresql.org/docs/9.4/static/sql-createrole.htm... for CREATE ROLE syntax (or you can use http://www.postgresql.org/docs/9.4/static/app-createuser.html http://www.postgresql.org/docs/9.4/static/app-createuser.htm... ) http://www.postgresql.org/docs/9.4/static/sql-grant.html http://www.postgresql.org/docs/9.4/static/sql-grant.html for GRANT syntax.
- 11y ago
- Kinnard 11y agoHave you asked a friend for help?
- saurik 11y agoThey already used "phone a friend" when they installed Python, so this time they are trying "ask the audience"; I can't wait to see them try and use "50/50" to install nginx.
- aembleton 11y agoTry running it inside docker: https://hub.docker.com/_/postgres/ https://hub.docker.com/_/postgres/ I find that to be the easiest way to get up and running with it.
- jakobegger 11y agoI'd love to hear what issues you're facing (if you can remember any specifics). Its been a long time since I first installed PostgreSQL, but I also recall some difficulties. Some things have improved since (eg. it's no longer necessary to change shared memory kernel parameters) but some things are still pretty difficult (eg. correctly configuring pg_hba.conf). Other things are just confusing to newcomers (eg. different meanings of the term "database" between MySQL and Postgres, or understanding schemas and search_path).
- thewhitetulip 11y agoHey, I installed it via the available things on ubuntu software center, I have the graphical utility installed but when I try to connect to it, it says invalid password and I have no idea what the default password is since it didnt ask me
- jimktrains2 11y agoHave you created a user? If you don't create a user, and aren't acting as the postgres user, how do you expect to connect?
- thewhitetulip 11y agoSadly though I have no idea how to do that, can you direct me to some easy to understand installation guide?
- MagicWishMonkey 11y agoReally? On OSX it's as simple as downloading postgres.app and dropping it in your applications folder. Couldn't be easier.
- thewhitetulip 11y agoI don't use OSX I use elementary OS and I installed everything but it says incorrect password and I have no damn clue what the default password is because while installation it didn't ask me for a password!
- jimktrains2 11y agoWhat documentation or tutorial were you following? The first thing you need to do is create a user (or act as the postgres user on your os) and if the doc or tutorial was an official one, it should be made more clear and you should file a bug, if it wasn't then you should contact the owner and tell them their tutorial isn't clear.
- thewhitetulip 11y agohttps://help.ubuntu.com/community/PostgreSQL https://help.ubuntu.com/community/PostgreSQL I got all the help from this thread and the above link!
- chungy 11y agoIt's easy on any major OS. Windows and OS X have one/two-click installers, Linux distros and BSDs pre-package it. The only really difficult case is a less-mainstream OS where you'll have to compile it, which honestly isn't that hard either.
- mrfusion 11y agoWhat's the significance of this?
- harel 11y agoYou don't have to write the entire jsonb column in order to update one field. Or you can perform various update operations on it. This is pretty cool
- colanderman 11y agoThis is incorrect. None of these functions modify the value of a column. All of them are purely functional and return a jsonb value with the specified field(s) replaced. The significance is one of performance and convenience: before, you would have had to construct a new jsonb object with only the field(s) you wanted modified changed. (In fact it is possible to define these new operators in terms of such; I have done so.) Now you can just use these handy built-in functions, which presumably perform better than the manual method as well.
- Someone 11y agoI think you are using different interpretations of "you". If you do: update aTable set loginInfo = loginInfo - 'lastLogin' where 'loginInfo' is a jsonb column, you, the programmer, need not write out the parts of the data to keep. PostgreSQL still sees this as 'read column, evaluate expression, write result', so it will read and write the entire jsonb value.
- kreneskyp 11y agoThis is only partially correct. These new features reduce the amount of data that must be transmitted to/from the postgres server and how much json must be parsed, but the full row is still written to the WAL (write ahead log). This is true even for partial updates to JSONB columns and even when only updating other non-JSONB columns in the row. When you do need to update JSONB columns this is a big improvement. You still should consider the size of your JSONB columns and the number & frequency of updates to those rows.
- erkose 11y agoSince when do we capitalize the 'g' in PostgreSQL? http://www.postgresql.org/ http://www.postgresql.org/
- Kiro 11y agoSo all this time people have been telling me to use Postgres instead of MongoDB without the ability to edit fields in my documents? What other basic functionality is it missing?
- colanderman 11y agoWhy not read its extensive documentation (http://www.postgresql.org/docs/9.5/static/ http://www.postgresql.org/docs/9.5/static/), evaluate its capabilities vs. those of MongoDB with respect to your particular use case and decide for yourself? SQL has never ever been meant for "editing documents", doing so is certainly not considered "basic functionality" for anyone whose use case is best served by a RDBMS, and you'll likely be displeased by the performance of such in Postgres (or any other RDBMS) if that is something you consider "basic functionality". (FWIW: what I've found to be the typical use case of JSON-in-SQL (or XML-in-SQL) is that of storing opaque JSON or XML blobs generated by some external service, which could perhaps benefit from indexed lookups within this data. If you're designing your main SQL database around JSON you're probably doing something wrong.)
- minimaxir 11y agoIdeally you should be using Postgres or any other relational database instead of MongoDB for technical reasons other than document storage. (e.g. ACID) Document storage in Postgres is a best-of-both-worlds approach (can store documents w/ ACID), with advantages of MongoDB and fewer downsides. But it's still relatively new functionality. (I've seen use cases of document storage for logging in-database and other quick-write/read-rarely data that would be a pain to normalize with consistent schema, which seems compelling)
- rpedela 11y ago9.5 completes the feature set for JSON document storage.
- harel 11y agoYou can edit in 9.4 by replacing the job content with the updated one.
- simoncion 11y ago
- deleted 11y ago[deleted]