Re: releasing space

2019-10-19 Thread Adrian Klaver
On 10/19/19 4:51 PM, Julie Nishimura wrote: an entire cluster *From:* Adrian Klaver *Sent:* Saturday, October 19, 2019 4:34 PM *To:* Julie Nishimura ; Tomas Vondra *Cc:* pgsql-general@lists.postgresql.org ;

Re: releasing space

2019-10-19 Thread Tomas Vondra
On Sat, Oct 19, 2019 at 04:34:32PM -0700, Adrian Klaver wrote: On 10/19/19 4:17 PM, Julie Nishimura wrote: Thank you, Thomas. Do you know if it is safe to replicate 9.6.2 (smaller) db to 9.6.15 (larger capacity) using pg_basebackup? Would it be considered as an upgrade? pg_basebackup backups

Re: releasing space

2019-10-19 Thread Adrian Klaver
On 10/19/19 4:17 PM, Julie Nishimura wrote: Thank you, Thomas. Do you know if it is safe to replicate 9.6.2 (smaller) db to 9.6.15 (larger capacity) using pg_basebackup? Would it be considered as an upgrade? pg_basebackup backups an entire Postgres cluster which will be many databases. So

Re: releasing space

2019-10-19 Thread Julie Nishimura
Thank you, Thomas. Do you know if it is safe to replicate 9.6.2 (smaller) db to 9.6.15 (larger capacity) using pg_basebackup? Would it be considered as an upgrade? From: Tomas Vondra Sent: Saturday, October 19, 2019 5:44 AM To: Julie Nishimura Cc:

Re: Execute a function through fdw

2019-10-19 Thread Jeff Janes
On Fri, Oct 18, 2019 at 7:55 AM Tom Lane wrote: > Guillaume Lelarge writes: > > Le ven. 18 oct. 2019 à 11:51, Patrick FICHE > a > > écrit : > >> Is it possible to execute a function located on a server accessed > through > >> Postgres fdw. > > > It's probably easier to create a view on the

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Ariadne Conill
Hello, On Sat, Oct 19, 2019, 3:27 PM Tomas Vondra wrote: > On Sat, Oct 19, 2019 at 12:47:39PM -0400, Andrew Dunstan wrote: > > > >On 10/19/19 12:32 PM, David G. Johnston wrote: > >> On Sat, Oct 19, 2019 at 9:19 AM Tomas Vondra > >> mailto:tomas.von...@2ndquadrant.com>> > >> wrote: > >> > >>

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Tomas Vondra
On Sat, Oct 19, 2019 at 12:47:39PM -0400, Andrew Dunstan wrote: On 10/19/19 12:32 PM, David G. Johnston wrote: On Sat, Oct 19, 2019 at 9:19 AM Tomas Vondra mailto:tomas.von...@2ndquadrant.com>> wrote: > >We invented jsonb_set() (credit to Dmitry Dolgov). And we've had it >since

Re: Postgres Point in time Recovery (PITR),

2019-10-19 Thread Avinash Kumar
Hi, On Sat, Oct 19, 2019 at 11:16 PM Daulat Ram wrote: > Hi All, > > > > Thanks for your suggestions. > > One more questions is, how backups are useful if we have streaming > replication . As I know, we can promote the standby as primary in case of > disaster at primary side. Do we need to

Re: Postgres Point in time Recovery (PITR),

2019-10-19 Thread Jeff Janes
On Fri, Oct 18, 2019 at 1:59 AM Daulat Ram wrote: > Hello All, > > Can you please share some ideas and scenarios how we can do the PITR in > case of disaster. > It depends on what you mean by "disaster". Usually I think that would mean your server (or entire data center) was destroyed. In

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Adrian Klaver
On 10/18/19 7:18 PM, Ariadne Conill wrote: Hello, On Fri, Oct 18, 2019 at 7:04 PM Adrian Klaver wrote: On 10/18/19 4:31 PM, Ariadne Conill wrote: Hello, On Fri, Oct 18, 2019 at 6:01 PM Adrian Klaver wrote: On 10/18/19 3:11 PM, Ariadne Conill wrote: Hello, On Fri, Oct 18, 2019 at 5:01

RE: Postgres Point in time Recovery (PITR),

2019-10-19 Thread Daulat Ram
Hi All, Thanks for your suggestions. One more questions is, how backups are useful if we have streaming replication . As I know, we can promote the standby as primary in case of disaster at primary side. Do we need to schedule backups if we have streaming replication? Thanks From: Avinash

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Andrew Dunstan
On 10/19/19 12:32 PM, David G. Johnston wrote: > On Sat, Oct 19, 2019 at 9:19 AM Tomas Vondra > mailto:tomas.von...@2ndquadrant.com>> > wrote: > > > > >We invented jsonb_set() (credit to Dmitry Dolgov). And we've had it > >since 9.5. That's five releases ago.  So it's a bit late to

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread David G. Johnston
On Sat, Oct 19, 2019 at 9:19 AM Tomas Vondra wrote: > > > >We invented jsonb_set() (credit to Dmitry Dolgov). And we've had it > >since 9.5. That's five releases ago. So it's a bit late to be coming to > >us telling us it's not safe (according to your preconceptions of what it > >should be

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Andrew Dunstan
On 10/19/19 12:18 PM, Tomas Vondra wrote: > On Sat, Oct 19, 2019 at 11:26:50AM -0400, Andrew Dunstan wrote: > > Not sure, but that seems rather confusing to me, because it's mixing SQL > NULL and JSON null, i.e. it's not clear to me why > >    jsonb_set(..., "...", NULL) > > should do the same

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Tomas Vondra
On Sat, Oct 19, 2019 at 11:21:26AM -0400, Stephen Frost wrote: Greetings, * Dmitry Dolgov (9erthali...@gmail.com) wrote: If we want to change it, the question is where to stop? Essentially we have: update table set data = some_func(data, some_args_with_null); where some_func happened to

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Tomas Vondra
On Sat, Oct 19, 2019 at 11:26:50AM -0400, Andrew Dunstan wrote: ... The hyperbole here is misplaced. There is a difference between a bug and a POLA violation. This might be the latter, but it isn't the former. So please tone it down a bit. It's not the function that's unsafe, but the

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Andrew Dunstan
On 10/18/19 3:10 PM, Mark Felder wrote: > > On Fri, Oct 18, 2019, at 12:37, Ariadne Conill wrote: >> Hello, >> >> I am one of the primary maintainers of Pleroma, a federated social >> networking application written in Elixir, which uses PostgreSQL in >> ways that may be considered outside the

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Stephen Frost
Greetings, * Dmitry Dolgov (9erthali...@gmail.com) wrote: > If we want to change it, the question is where to stop? Essentially we have: > > update table set data = some_func(data, some_args_with_null); > > where some_func happened to be jsonb_set, but could be any strict function. I don't

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Christoph Moench-Tegeder
## Ariadne Conill (aria...@dereferenced.org): > NULL propagation makes sense in the context of traditional SQL. What > users expect from the JSONB support is for it to behave as JSON > manipulation behaves everywhere else. Well, some users expect that. Others are using this interface as it is

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Dmitry Dolgov
> On Sat, Oct 19, 2019 at 1:08 PM Tomas Vondra > wrote: > > >Here is how other implementations handle this case: > > > >MySQL/MariaDB: > > > >select json_set('{"a":1,"b":2,"c":3}', '$.a', NULL) results in: > > {"a":null,"b":2,"c":3} > > > >Microsoft SQL Server: > > > >select

Re: Has there been any discussion of custom dictionaries being defined in the database?

2019-10-19 Thread Tomas Vondra
On Thu, Oct 17, 2019 at 11:52:39AM +0200, Tom Lane wrote: Morris de Oryx writes: Given that Amazon is bragging this week about turning off Oracle, it seems like they could kick some resources towards contributing something to the Postgres project. With that in mind, is the idea of defining

Re: releasing space

2019-10-19 Thread Tomas Vondra
On Thu, Oct 17, 2019 at 05:20:09PM +, Julie Nishimura wrote: Hello everybody, We are running PostgreSQL 9.6.2 cluster master -> standby (streaming replication). 22 tb of space (constantly struggling with the space, pruning the old data, but not fast enough). The biggest db takes 16 tb. So,

Re: Replication of Replication

2019-10-19 Thread Tomas Vondra
On Fri, Oct 18, 2019 at 05:54:34PM -0400, Edilmar Alves wrote: I have 3 servers running CentOS+PG 11 (postgresql11-server-11.5-1PGDG.rhel7.x86_64): - s1: main db + publication - s2: subscription of the main db all works fine until here... Now, I tried to config this: - s2: publication of the

Re: Securing records using linux grou permissions

2019-10-19 Thread Peter J. Holzer
On 2019-10-15 13:10:13 -0400, David Gauthier wrote: > I was hoping there was a way to integrate the user/permissions/groups in linux > with the PG permissions functionality.  You can at least map the OS users to DB roles by using the peer or ident authentication schemes. This way the users won't

Re: jsonb_set() strictness considered harmful to data

2019-10-19 Thread Ariadne Conill
Hello, On Sat, Oct 19, 2019 at 12:52 AM Pavel Stehule wrote: > > > > so 19. 10. 2019 v 7:41 odesílatel David G. Johnston > napsal: >> >> On Friday, October 18, 2019, Pavel Stehule wrote: >> >>> >>> Probably there will be some applications that needs NULL result in >>> situations when value