Re: update field in jsonb

2017-11-22 Thread Oleg Bartunov
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}); > >

Re: update field in jsonb

2017-11-22 Thread Ivan E. Panchenko
23.11.2017 04:45, 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-

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,

Re: backends stuck in "startup"

2017-11-22 Thread Tom Lane
Justin Pryzby writes: > On Wed, Nov 22, 2017 at 07:43:50PM -0500, Tom Lane wrote: >> My hypothesis about a missed memory barrier would imply that there's (at >> least) one process that's waiting but is not in the lock's wait queue and > Do I have to also check the wait queue to verify? Give a hi

Re: backends stuck in "startup"

2017-11-22 Thread Justin Pryzby
On Wed, Nov 22, 2017 at 07:43:50PM -0500, Tom Lane wrote: > Justin Pryzby writes: > > For starters, I found that PID 27427 has: > > > (gdb) p proc->lwWaiting > > $1 = 0 '\000' > > (gdb) p proc->lwWaitMode > > $2 = 1 '\001' > > To confirm, this is LWLockAcquire's "proc", equal to MyProc? > If so,

Re: query causes connection termination

2017-11-22 Thread Tom Lane
Tomas Vondra writes: > On 11/23/2017 01:25 AM, Neto pr wrote: >> Anyone have any tips on why this occurs? > Attach gdb to the backend, run the query and when it fails get us the > backtrace. So something like More details on that here: https://wiki.postgresql.org/wiki/Generating_a_stack_trace_o

Re: backends stuck in "startup"

2017-11-22 Thread Tom Lane
Justin Pryzby writes: > For starters, I found that PID 27427 has: > (gdb) p proc->lwWaiting > $1 = 0 '\000' > (gdb) p proc->lwWaitMode > $2 = 1 '\001' To confirm, this is LWLockAcquire's "proc", equal to MyProc? If so, and if LWLockAcquire is blocked at PGSemaphoreLock, that sure seems like a sm

Re: query causes connection termination

2017-11-22 Thread Tomas Vondra
On 11/23/2017 01:25 AM, Neto pr wrote: > Another fact is that when executing the query without the command > EXPLAIN ANALYZE, the result is usually returned after a few minutes. > I do not understand, because when using the EXPLAIN ANALYZE command the > dbms closes the connection.  > Anyone have a

Re: query causes connection termination

2017-11-22 Thread Neto pr
Another fact is that when executing the query without the command EXPLAIN ANALYZE, the result is usually returned after a few minutes. I do not understand, because when using the EXPLAIN ANALYZE command the dbms closes the connection. Anyone have any tips on why this occurs? 2017-11-22 21:19 GMT-0

Re: query causes connection termination

2017-11-22 Thread Neto pr
Only complementing I use postgresql version 10. However the postgresql.conf file has standard settings. My server is a 2.8 GHz Xeon (4 core) and SSDs disc. 2017-11-22 21:12 GMT-03:00 Neto pr : > Dear all, > when executing a query, it causes the database to close the connection. > See the error re

query causes connection termination

2017-11-22 Thread Neto pr
Dear all, when executing a query, it causes the database to close the connection. See the error reported by the SQL TOOL DBEAVER tool: - DBEAVER SQL tool- An I / O error occurred while sending to the backend. java.io.EOFException: ---

Re: backends stuck in "startup"

2017-11-22 Thread Justin Pryzby
On Wed, Nov 22, 2017 at 01:27:12PM -0500, Tom Lane wrote: > Justin Pryzby writes: > > On Tue, Nov 21, 2017 at 03:40:27PM -0800, Andres Freund wrote: > >> Could you try stracing next time? > > > I straced all the "startup" PIDs, which were all in futex, without > > exception: > > If you've got d

Re: backends stuck in "startup"

2017-11-22 Thread Justin Pryzby
On Wed, Nov 22, 2017 at 01:27:12PM -0500, Tom Lane wrote: > Justin Pryzby writes: > [ in an earlier post: ] > > BTW this is a VM run on a hypervisor managed by our customer: > > DMI: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, > > BIOS 6.00 06/22/2012 > > Hmm. Can't a

Re: backends stuck in "startup"

2017-11-22 Thread Tom Lane
Justin Pryzby writes: > On Tue, Nov 21, 2017 at 03:40:27PM -0800, Andres Freund wrote: >> Could you try stracing next time? > I straced all the "startup" PIDs, which were all in futex, without exception: If you've got debug symbols installed, could you investigate the states of the LWLocks the p

Re: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Carl Karsten
I would like to remind everyone that a) we are all friends, and b) we don't need to reply to everything. Now for some humour https://xkcd.com/386/ "someone is wrong on the internet" Tail of Banana talk, just before Get me off your ... very strong language https://youtu.be/eC9rmsI7dnw?t=1m32s (I

Re: duplicate primary key

2017-11-22 Thread Alexander Pyhalov
On 11/22/17 07:24 PM, Magnus Hagander wrote: What is your postgres version, and what's the "version history" of upgrades from it (talking pg_upgrade upgrades, not dump/reload upgrades). This might be fallout from old bugs thaat have been known to cause this type of problem. It's PostgreSQL 9.

Re: duplicate primary key

2017-11-22 Thread Magnus Hagander
On Wed, Nov 22, 2017 at 12:05 PM, Alexander Pyhalov wrote: > Hello. > > I'm a bit shocked. During import/export of our database we've found a > duplicate primary key. > > # \d player > > Table "public.player" >Column |Type | > Modifiers > ---

Re: Set role dynamically from proc

2017-11-22 Thread David G. Johnston
On Wed, Nov 22, 2017 at 7:52 AM, Durumdara wrote: > Now the "set role" uses the "variable name", and not the "value of the > variable". > > This is what I don't like in this lang. I need to write a special variable > name to "force" to use it, and not other thing. > I don't know how to force the

[GENERAL] postgres_fdw & could not receive data from client: Connection reset by peer

2017-11-22 Thread Adam Brusselback
Hey all, first off... Postgres version: 10.1 OS: Debian 9.0 So I have a database called: authentication It stores my user table for my application. I have it separated from the main database of my application to allow the same account to be used by multiple instances of my application. >From a c

Re: Set role dynamically from proc

2017-11-22 Thread Durumdara
Hello! I haven't got your mail, I see your answer only in the thread of web mailing list. > It seems that the user does not exist: The problem is based on that I want to set the role to the database owner from script. My team members many times logged as "postgres" or diff user, and forget to se

Re: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Tom Lane
Geoff Winkless writes: > On 22 November 2017 at 14:19, Vick Khera wrote: >> This sounds to me like you're going to run afoul of CAN-SPAM unsubscribe >> rules. You should re-think this workflow. > CAN-SPAM only applies to commercial email, "the primary purpose of > which is the commercial advert

Re: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Stephen Frost
Vick, * Vick Khera (vi...@khera.org) wrote: > On Wed, Nov 22, 2017 at 9:07 AM, Stephen Frost wrote: > > * Mike Sofen (mso...@runbox.com) wrote: > > > Confirmed, I did not get a reset email either. Also, I had subscribed > > to the digest version and now I get individual emails - which is why I >

Re: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Geoff Winkless
On 22 November 2017 at 14:19, Vick Khera wrote: > > This sounds to me like you're going to run afoul of CAN-SPAM unsubscribe > rules. You should re-think this workflow. CAN-SPAM only applies to commercial email, "the primary purpose of which is the commercial advertisement or promotion of a com

Re: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Vick Khera
On Wed, Nov 22, 2017 at 9:07 AM, Stephen Frost wrote: > Greetings everyone, > > * Mike Sofen (mso...@runbox.com) wrote: > > Confirmed, I did not get a reset email either. Also, I had subscribed > to the digest version and now I get individual emails - which is why I > needed to login, but my pas

RE: Set role dynamically from proc

2017-11-22 Thread Charles Clavadetscher
Hello From: Durumdara [mailto:durumd...@gmail.com] Sent: Mittwoch, 22. November 2017 14:56 To: pgsql-gene...@postgresql.org Subject: Set role dynamically from proc Hello! May you know the way how to set role dynamically. DO $$ DECLARE act_dbowner varchar(100); BEGIN

Re: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Stephen Frost
Greetings everyone, * Mike Sofen (mso...@runbox.com) wrote: > Confirmed, I did not get a reset email either. Also, I had subscribed to the > digest version and now I get individual emails - which is why I needed to > login, but my password no longer worked. Sigh. Mike I've replied to Mike di

Re: Reset Sequence number

2017-11-22 Thread Thomas Kellerer
Brahmam Eswar schrieb am 22.11.2017 um 10:36: > > we are in process of migrating to postgres and need to reset the > sequence number with highest value of table key. I want to make it > procedural to do that as mentioned below, But it's throwing an error > DO $$ >  DECLARE >  SEQ BIGINT; >  BEGIN

Error "XX000: cache lookup failed for index 901261397"

2017-11-22 Thread Rupesh Mashru
Hello team, We are using postgresql 9.4. Recently we are starting to get the error "XX000: cache lookup failed for index 901261397" randomly on a few functions. Other wise in general the function executes fine without any errors. The functions which cause this error have one or two tables in commo

Set role dynamically from proc

2017-11-22 Thread Durumdara
Hello! May you know the way how to set role dynamically. DO $$ DECLARE act_dbowner varchar(100); BEGIN SELECT u.usename into act_dbowner FROM pg_database d JOIN pg_user u ON (d.datdba = u.usesysid) WHERE d.datname = (SELECT current_database()); raise notice 'DB owner: %', act_dbowner; *set role

testing

2017-11-22 Thread Rakesh Kumar
Sorry, outlook is not showing all mails.  Trying this now.

RE: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Mike Sofen
Confirmed, I did not get a reset email either. Also, I had subscribed to the digest version and now I get individual emails - which is why I needed to login, but my password no longer worked. Sigh. Mike -Original Message- From: Niels Kristian Schjødt [mailto:nielskrist...@autouncle.co

Re: duplicate primary key

2017-11-22 Thread Thomas Markus
Am 22.11.17 um 12:05 schrieb Alexander Pyhalov: Hello. I'm a bit shocked. During import/export of our database we've found a duplicate primary key. # \d player Table "public.player"    Column   |    Type |     Modifiers --

Re: backends stuck in "startup"

2017-11-22 Thread Justin Pryzby
On Tue, Nov 21, 2017 at 03:40:27PM -0800, Andres Freund wrote: > Hi, > > On 2017-11-21 17:09:26 -0600, Justin Pryzby wrote: > > I'm sorry to report this previously reported problem is happening again, > > starting shortly after pg_upgrading a customer to PG10.1 from 9.6.5. > > > > As $subject: ba

duplicate primary key

2017-11-22 Thread Alexander Pyhalov
Hello. I'm a bit shocked. During import/export of our database we've found a duplicate primary key. # \d player Table "public.player" Column |Type | Modifiers +-+--

Re: [GENERAL] Reset Sequence number

2017-11-22 Thread Wèi Cōngruì
The 'SEQ' part can't be substituted by variable. https://www.postgresql.org/docs/10/static/plpgsql-implementation.html DO $$ DECLARE SEQ BIGINT; BEGIN SEQ := (SELECT MAX(ID) FROM TABLE_1); EXECUTE format('ALTER SEQUENCE TABLE_1_SEQ RESTART WITH %s', SEQ); END $$; On Wed, Nov 22, 2017 at 6

Re: [GENERAL] Reset Sequence number

2017-11-22 Thread Raymond O'Donnell
On 22/11/17 09:36, Brahmam Eswar wrote: we are in process of migrating to postgres and need to reset the sequence number with highest value of table key . I want to make it procedural to do that as mentioned below,But it's throwing an error . DO $$  DECLARE  SEQ BIGINT;  BEGIN SEQ:=(SEL

Re: [GENERAL] Reset Sequence number

2017-11-22 Thread amul sul
Firstly, anonymous procedures are not supported in PostgreSQL, you need to embed this block in a plpgsql function[1] body & call that function if you want reset sequence value manually, or you could use CYCLE option[2] of a sequence to auto reset. 1] https://www.postgresql.org/docs/9.6/static/plp

[GENERAL] Reset Sequence number

2017-11-22 Thread Brahmam Eswar
we are in process of migrating to postgres and need to reset the sequence number with highest value of table key . I want to make it procedural to do that as mentioned below,But it's throwing an error . DO $$ DECLARE SEQ BIGINT; BEGIN SEQ:=(SELECT MAX(ID) FROM TABLE_1); ALTER SEQUENCE TA

Re: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Niels Kristian Schjødt
The password reset form does not work. I do not get any reset emails when entering mine, so I can’t unsubscribe. > Den 22. nov. 2017 kl. 04.24 skrev Stephen Frost : > > Igor, > > * Igor Korot (ikoro...@gmail.com) wrote: >> Can anyone explain why? >> Why not do what other ML do - provide the lin

Re: One Partition by list is always chosen by planner

2017-11-22 Thread legrand legrand
Hello, thank you for this answer. I just wanted to add a few informations. This table has in fact around 20 partitions, explain select * from wiki_data_part where category='fr' returns only 2 partitions (meaning that constraint_exclusion works) the partition that is always scanned has more tha