[GENERAL] store and retrieve html in postgres from rails

2015-03-30 Thread john.tiger
want to include html text from newsletters into postgres - then retrieve have seen posts saying this is really difficult (?) and others just sugesting pg_escape_string and pg entities - tried to put into text field but it seems stripped out does anyone have a good suggestion -- Sent via pgsql

[GENERAL] replacing jsonb field value

2015-05-29 Thread john.tiger
using 9.4.2 suppose we have create table test (id serial primary key, data jsonb); insert into test (data) values ({"a":1, "b":2}) want to replace "b" with 3 okay, we are retrieving entire record res = select * from test where data ->> b = 2 newrec = res newrec["b" = 3 delete from test where

[GENERAL] return jsonb without field label

2015-07-03 Thread john.tiger
have tables with : create table mydocs (id serial primary key, data jsonb) when I do a select data from mydocs it comes back as {data: {my jsonb fields}} which then gets passed into a template - don't want to have to keep using <%= article.data.name %> instead of just data.name probably e

[GENERAL] using postgresql for session

2015-10-07 Thread john.tiger
has anyone used postgres jsonb for holding session ? Since server side session is really just a piece of data, why bother with special "session" plugins and just use postgres to hold the data and retrieve it with psycopg2 ? Maybe use some trigger if session changes?We are using python Bot

[GENERAL] ruby pg connection fails on centos - okay on debian and dev machine

2016-05-03 Thread john.tiger
our model.rb runs fine on a dev machine and a debian server but is failing on a new centos server - checked the postgres db name and user name and password - all seem fine could it be: host => "localhost" or maybe CORS ? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] ruby pg connection fails on centos - okay on debian and dev machine

2016-05-04 Thread john.tiger
On 05/03/2016 06:18 PM, Adrian Klaver wrote: On 05/03/2016 05:07 PM, john.tiger wrote: our model.rb runs fine on a dev machine and a debian server but is failing on a new centos server - checked the postgres db name and user name and password - all seem fine The error message is? could it

[GENERAL] screwed up authentication

2014-06-05 Thread john.tiger
debian jessie 9.3 latest upgrade su - postgres password: x ==> Authentication failure edited pg_hba.conf ==> local all all trust restarted still failure sudo -u postgres pgsql ===> access okay, figure this is a problem with postgresql user vs linux user - but how to fix ? is it ea

[GENERAL] inserting a text file via json

2014-09-05 Thread john.tiger
we want to store markdown text files into our json fields - can this be done ? I guess we could have a separate json field and bytea field for the markdown file but this might be difficult when it comes to our REST response - anyone do something like this ? -- Sent via pgsql-general mailing

[GENERAL] installing on mac air development machine

2014-10-02 Thread john.tiger
we've always installed on linux so need help with a new mac air running latest osx in the instructions it shows several methods: 1) enterprisedb (but this does not look open source ?) 2) fink 3) macports 4) source etc what do most use ? thks ps: is there a mac build for 9.4 beta 3 yet ? we

[GENERAL] json query problem

2014-01-02 Thread john.tiger
trying to select a row of json type returning the entire json record table users id, jsondata jsondata has {"username":"jdoe", } select json_to_row from users where jsondata->"username" = "jdoe"; fails on operator -> unknown using debian testing with postgresql backport ppa psql: 9.3.2

[GENERAL] problems with debian testing install or documentation

2014-01-02 Thread john.tiger
tried to follow instructions from postgresql.org/download/linux/debian 1) choice for debian versions wheezy and sid - not for testing (jessie) 2) no mention if any portions of old version should be removed 3) since I'm working on a dev machine, went ahead and removed everything - there are no

[GENERAL] debian 9.3 install history file permission denied

2014-01-03 Thread john.tiger
To get 9.3 installed, postgresql was completely removed (incl folders) and reinstalled. Had to manually check postgresql on the services menu to launch the server. All seems to work but getting error on \q with history file permission denied. What is best way to fix this ? -- Sent via pg

[GENERAL] returning json data row from json query

2014-01-03 Thread john.tiger
select * from users where jsondata->>'username' = 'jdoe' works but returns field names, etc besides the data row.how can we get json data back ? select row_to_json from users where jsondata->>'username'='jdoe' didn't work. any ideas ? thks. -- Sent via pgsql-general mailing list (pgsql

[GENERAL] any examples - sync offline json to server

2014-01-25 Thread john.tiger
scenario: download key data in json format to mobile - then use offline (ie in areas where no wifi available) - then when back in wifi range, sync with db server this is what pouch, couch offers but would like to do with postgresql if possible -- Sent via pgsql-general mailing list (pgsql-

[GENERAL] Josh's Comments on Hstore / Jsonb

2014-02-25 Thread john.tiger
Somehow my comments didn't go thru on the soup blog but wanted to throw in more support for this patch Josh, you are so right on the money. An ACID compliant db that serves JSON is great. Sorry I didn't make SCALE this year to hear the PG talks and stop by and say hi. Maybe at Open West ?

[GENERAL] 9.3 debian install setup failure

2014-03-21 Thread john.tiger
9.3 install on debian jessie 64amd sudo -u postgres psql => worked alter user postgres with password 'password' => alter role su - postgress enter password => authentication failure hba.conf edited to allow "trust" to local - shouldn't this be set up as standard default ? still authent

Re: [GENERAL] 9.3 debian install setup failure

2014-03-21 Thread john.tiger
thks for quick comments - see below: On 03/21/2014 06:00 PM, Adrian Klaver wrote: On 03/21/2014 04:47 PM, john.tiger wrote: 9.3 install on debian jessie 64amd sudo -u postgres psql => worked alter user postgres with password 'password' => alter role su - postgres

Re: [GENERAL] 9.3 debian install setup failure

2014-03-21 Thread john.tiger
On 03/21/2014 06:43 PM, Rodrigo Gonzalez wrote: On 03/21/2014 09:29 PM, john.tiger wrote: EDIT from @rodrigo hmm, user postgres vs os postgres - okay understand what you mean but how is this fixed ? or what is proper procedure ? It depends on what you want to fix... if you want to be

[GENERAL] thanks core team for jsonb

2014-03-24 Thread john.tiger
thks for committing this into 9.4 Also great decision to resolve what to us was some confusion between the json vs hstore choice. My decision to move our products to postgresql looks better every day. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to y