update field in jsonb

2017-11-22 Thread support-tiger
is there a way to update a single field in jsonb without replacing the 
entire json document - couldn't find an example


for example

create table test (id primary key, data jsonb);

insert into test ({"name":"bill", "age":29});

 ?? update test   set data->age = 30


--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310





Re: update field in jsonb

2017-11-23 Thread support-tiger

Oleg,

hey, thanks so much - if you are in USA visiting Yellowstone Natl Park 
contact me and the beer is on me (maybe a Wyoming steak too!)



On 11/22/2017 11:27 PM, Oleg Bartunov wrote:

On Thu, Nov 23, 2017 at 4:45 AM, support-tiger  wrote:

is there a way to update a single field in jsonb without replacing the
entire json document - couldn't find an example

for example

create table test (id primary key, data jsonb);

insert into test ({"name":"bill", "age":29});

  ?? update test   set data->age = 30


update test set data = jsonb_set(data, '{age}', '30'::jsonb);



--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310







--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310





pg data backup from vps

2017-12-01 Thread support-tiger
To diversify risk, we would like to have a daily or weekly data backup 
stored in another location besides the VPS service we are using - 
pg_dump is great for the backup but transferring a growing db across the 
internet to a local machine disk seems slow - how are others handling 
this with postgresql ?  Thks.


--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310





problems with postgresql 10.1 hba_conf on fedora 27

2017-12-20 Thread support-tiger

can someone please help ?

postgresql-10

fedora 27

our hba_conf that worked with pg 9x

local    all   all   postgres    peer

host    all    all   127.0.0.1/32 md5

host    all    all   ::1/128  md5

now gives error on restart and we cannot find the  log file

postgres remains so damn difficult and time wasting to quickly get up 
and running  vs other db's and docs don't help much





--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310





Re: problems with postgresql 10.1 hba_conf on fedora 27

2017-12-20 Thread support-tiger



On 12/20/2017 06:33 PM, David G. Johnston wrote:
On Wednesday, December 20, 2017, rob stone > wrote:



> local    all   all       postgres                peer
>
> host    all    all 127.0.0.1/32   md5
>
> host    all    all       ::1/128                  md5
>
> now gives error on restart and we cannot find the  log file
>

"local" is for socket connections, yet you have an address of
"postgres". How did this function in the past?


Sorta, but correct enough.  Local lines and host lines have differing 
numbers of columns.  As written the auth-method is "Postgres" with 
auth-option of "md5" (i.e., there is no address column for 
local) which is simply wrong.  Whether it's an email typo or the 
actual file...


bingo!  Thks - should be "local all postgres  peer"  (how many times we 
looked at this and didn't see it  (:   But if this setup is not good, we 
would like to know what it should be - our case is for accessing from 
Ruby app using pg gem on same server (at least for now)


No, the docs for understanding  hba_conf are not good (yes we can read 
and are fairly smart)  - we made suggestions the last time for several 
case examples and were ignored - okay, simplicity of pouchdb/couchdb  is 
getting our attention










I suspect it's possible we used to ignore malformed lines whereas now 
we error...


David J.



--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310



pg 10.1 missing libpq in postgresql-devel

2018-01-25 Thread support-tiger
running postgresql 10.1 on Fedora 27.  Cannot install ruby pg gem due to 
missing libpq-fe.h file.  This is usually found in postgresql-devel but 
it is not in fedora 27 postgresql10-devel. If install postgresql-devel 
(9.6) the gem installs without problem but afraid this will interfere 
with 10.1  How can we install the necessary libpq-fe.h  ?  thks



--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310





Re: pg 10.1 missing libpq in postgresql-devel

2018-01-27 Thread support-tiger

sorry for delay but ran some tests on older version pg gem - still fails

it fails on building the config file with simply missing libpq-fe.h,  
cannot find libpq-fe.h


I suspect it is a problem with using the pgdg repository and that 
postgresql get "10" added to them ie postgresql10-devel and maybe the 
gem code does not recognize that.   Since vers 10 is not breaking it 
does not make sense (i guess fedora)  to rename vers 10 with the "10" - 
maybe they just love the python 2 / 3 fiasco and want to extend it to 
postgresql.





On 01/25/2018 03:59 PM, Adrian Klaver wrote:

On 01/25/2018 12:20 PM, support-tiger wrote:
running postgresql 10.1 on Fedora 27. Cannot install ruby pg gem due 
to missing libpq-fe.h file.  This is usually found in 
postgresql-devel but 


What was the error message returned when you tried to install originally?

it is not in fedora 27 postgresql10-devel. If install 
postgresql-devel (9.6) the gem installs without problem but afraid 
this will interfere with 10.1  How can we install the necessary 
libpq-fe.h  ?  thks








--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310





Re: pg 10.1 missing libpq in postgresql-devel

2018-01-29 Thread support-tiger

On 01/27/2018 06:43 PM, Adrian Klaver wrote:


On 01/27/2018 04:34 PM, support-tiger wrote:

sorry for delay but ran some tests on older version pg gem - still fails


With what error message?

What Ruby gem?



it fails on building the config file with simply missing libpq-fe.h, 
cannot find libpq-fe.h


Well it is there:

rpm -qlp postgresql10-devel-10.1-1PGDG.f27.x86_64.rpm | grep libpq-fe.h
warning: postgresql10-devel-10.1-1PGDG.f27.x86_64.rpm: Header V4 
DSA/SHA1 Signature, key ID 442df0f8: NOKEY

/usr/pgsql-10/include/libpq-fe.h



I suspect it is a problem with using the pgdg repository and that 
postgresql get "10" added to them ie postgresql10-devel and maybe the 
gem code does not recognize that.   Since vers 10 is not breaking it 
does not make sense (i guess fedora)  to rename vers 10 with the "10" 
- maybe they just love the python 2 / 3 fiasco and want to extend it 
to postgresql.


Previous versions used version numbering also:

https://yum.postgresql.org/9.6/fedora/fedora-26-x86_64/

postgresql96-devel-9.6.6-1PGDG.f26.x86_64.rpm

My guess it that the config script for the gem is not taking into 
account that Postgres changed from a three part versioning system 
X.Y.z to a two part system X.y(where lower case is minor version) from 
9.6.0 to 10.1.


could be, cannot find the config file in the repository - specifies to 
use a pg-config file to build the gem but no trace of such a config file


thks anyway for your help.  had emailed the pg gem leads but no response 
and github issues are blocked (duh)  - can't depend on this -will just 
make a faster transition to Crystal - the pg shard in Crystal loaded 
okay on Fedora with the 10.1












On 01/25/2018 03:59 PM, Adrian Klaver wrote:

On 01/25/2018 12:20 PM, support-tiger wrote:
running postgresql 10.1 on Fedora 27. Cannot install ruby pg gem 
due to missing libpq-fe.h file. This is usually found in 
postgresql-devel but 


What was the error message returned when you tried to install 
originally?


it is not in fedora 27 postgresql10-devel. If install 
postgresql-devel (9.6) the gem installs without problem but afraid 
this will interfere with 10.1  How can we install the necessary 
libpq-fe.h  ? thks













--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310