last day (27 days later) » 

9:19 PM
0
A: append a json object to an array within my postgres table

Roman TkachukFor 9.5: UPDATE site_content SET content = jsonb_set(content, '{playersContainer,players}'::text[], content->'playersContainer'->'players' || '${json}'::jsonb); where id = :id

 
I get this error because: ERROR: operator does not exist: jsonb || jsonb Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 164
 
|| jsonb Concatenate two jsonb values into a new jsonb value (postgresql.org/docs/9.5/static/functions-json.html )
You use 9.5 or 9.4 postgresql?
 
I have 9.5 installed on my machine
 
Than all must work
For 9.4 does not exists neither json[b]_set nor ||
 
I recently upgraded to 9.5 do i have to anything to my databases to use 9.5?
 
9:19 PM
Do you restart db? could you provide what write psql when you connect?
 
hi there
I have just changed the port on 9.5 postgresql.conf to 5432
and the old one to 5433
and just restart my postgres service
 
good
psql sqldb
psql (9.5.4, server 9.6.1)
WARNING: psql major version 9.5, server major version 9.6.
Some psql features might not work.
Type "help" for help.
You can see something like this?
 
ah it's now asking for a password
but I haven't set a new password
after i changed to 9.5
 
modify pg_hba.conf to accept connection from localhost without password (trust)
 
how do i do that in pg_hba.conf
sorry new to postgres
 
9:29 PM
local all postgres trust # for local connection
host all all 127.0.0.1/32 trust # for tcp connection - if you use -h 127.0.0.1 as argument when you call psql
can you provide your psql commend? or you connect via pgAdmin?
 
usually pgadmin
I'm still getting authentication errors
it's asking for a password for my user but i've never set a password or had to use one until I upgraded to 9.5
 
Ok. Now you try to connect to server via pgAdmin or psql?
try: sudo -u postgres psql <yourdbname>
 
Ok i am finally in
and I can see my db is now running 9.5
i will try that query again
in pgadmin
 
beautiful!
 
when try run
psql
i get psql
psql: FATAL: database "pocockn" does not exist
there shouldn't be a db called pocockn as thats my user
surely
 
9:43 PM
You can work in pgAdmin.
Just try it in pgAdmin
it is more convenient to me to use psql - because when I start to use postgres in 1996 it was only psql :-)
 
9:56 PM
Are all is ok?
 

  last day (27 days later) »