Re: Fast logical replication jump start with PG 10

2018-05-25 Thread Adrian Klaver
On 05/25/2018 06:35 PM, Olivier Gautherot wrote: Hi Adrian, thanks for your reply. Here is the clarification. 1) It is indeed a pg_upgrade from 9.2 to 10.4. Depending on the test machine, it runs in between 15 and 20 minutes for just over 100GB. I can negotiate this time with our customer. The

Re: Fast logical replication jump start with PG 10

2018-05-25 Thread Olivier Gautherot
Hi Adrian, thanks for your reply. Here is the clarification. 1) It is indeed a pg_upgrade from 9.2 to 10.4. Depending on the test machine, it runs in between 15 and 20 minutes for just over 100GB. I can negotiate this time with our customer. The vacuum process took another 5 to 7 minutes. This thi

Re: Fast logical replication jump start with PG 10

2018-05-25 Thread Adrian Klaver
On 05/25/2018 02:12 PM, Olivier Gautherot wrote: Hi, I just sent the question on StackOverflow but realized that this audience may be more savvy. So sorry in advance for cross-posting... I'm in the process of upgrading a PG from 9.2 to 10.4. pg_upgrade worked fine on the master and was rathe

Re: Syndicating PostgreSQL mailing list to Discourse

2018-05-25 Thread Ian Zimmerman
On 2018-05-25 14:03, Adrian Klaver wrote: > > If our mirror archive gets enough traction we'd like to make it > > possible to sign up to the forum and seamlessly interact with the > > mailing list, > > Well 'seamlessly works' would be the important part. In the past when > this was tried(can't re

Re: Syndicating PostgreSQL mailing list to Discourse

2018-05-25 Thread Tom Lane
Adrian Klaver writes: > On 05/25/2018 01:03 PM, Erlend Sogge Heggen wrote: >> If our mirror archive gets enough traction we'd like to make it possible >> to sign up to the forum and seamlessly interact with the mailing list, > Well 'seamlessly works' would be the important part. In the past whe

Fast logical replication jump start with PG 10

2018-05-25 Thread Olivier Gautherot
Hi, I just sent the question on StackOverflow but realized that this audience may be more savvy. So sorry in advance for cross-posting... I'm in the process of upgrading a PG from 9.2 to 10.4. pg_upgrade worked fine on the master and was rather fast. The problem is that the database is replicated

Re: Syndicating PostgreSQL mailing list to Discourse

2018-05-25 Thread Adrian Klaver
On 05/25/2018 01:03 PM, Erlend Sogge Heggen wrote: Hey all, I'm with the Discourse.org team and I'm just here to ask if anyone would be interested in having a read-only Discourse mirror of the PostgreSQL mailing list. Since it's read-only it would only be used for things like: * Fast sear

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-25 Thread Peter Geoghegan
On Fri, May 25, 2018 at 1:38 PM, Andres Freund wrote: >> BTW I think the definition of HeapTupleHeaderXminFrozen is seriously >> confusing, by failing to return true if the xmin is numerically >> FrozenXid (which it'll be if the database was pg_upgraded). I wonder >> about this one in HeapTupleSa

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-25 Thread Andres Freund
On 2018-05-24 16:46:24 -0400, Alvaro Herrera wrote: > On 2018-May-24, Andres Freund wrote: > > > On 2018-05-24 13:08:53 -0400, Alvaro Herrera wrote: > > > Hmm .. surely > > > > xid = HeapTupleHeaderGetXmin(tuple); > > > xmin_frozen = ((xid == FrozenTransactionId) || > > >

Syndicating PostgreSQL mailing list to Discourse

2018-05-25 Thread Erlend Sogge Heggen
Hey all, I'm with the Discourse.org team and I'm just here to ask if anyone would be interested in having a read-only Discourse mirror of the PostgreSQL mailing list. Since it's read-only it would only be used for things like: - Fast search with advanced filters (Discourse puts PostgreSQL ful

Re: case statement within insert

2018-05-25 Thread Francisco Olarte
On Fri, May 25, 2018 at 11:04 AM, tango ward wrote: > CASE > WHEN code like '%%PE%%' or code like '%%NSTP%%' > THEN True > ELSE False I cannot advise you on the %% stuff, which I do not totally understand, but CASE WHEN condition

Re: case statement within insert

2018-05-25 Thread Adrian Klaver
On 05/25/2018 07:05 AM, Adrian Klaver wrote: On 05/25/2018 06:52 AM, Adrian Klaver wrote: On 05/25/2018 02:04 AM, tango ward wrote: I want to insert data from mysql into a table in postgresql. I want to check when the subjectcode contains PE or NSTP so I can assign True or False to another

Re: Insert data if it is not existing

2018-05-25 Thread Raymond O'Donnell
On 25/05/18 14:35, Igor Neyman wrote: '''INSERT INTO my_table(name, age) VALUES( %s, %s) WHERE NOT EXISTS(SELECT name FROM my_table WHERE name=%s)''', ('Scott', 23, 'Scott')) I haven't been following this thread, so maybe this has already been said, but I think you need a SELECT in there a

Re: case statement within insert

2018-05-25 Thread Adrian Klaver
On 05/25/2018 06:52 AM, Adrian Klaver wrote: On 05/25/2018 02:04 AM, tango ward wrote: I want to insert data from mysql into a table in postgresql. I want to check when the subjectcode contains PE or NSTP so I can assign True or False to another column in destination DB. # Source data:  

Re: case statement within insert

2018-05-25 Thread Adrian Klaver
On 05/25/2018 02:04 AM, tango ward wrote: I want to insert data from mysql into a table in postgresql. I want to check when the subjectcode contains PE or NSTP so I can assign True or False to another column in destination DB. # Source data:  # Source data: MySQL    curr_msql.execute(''

Re: postgres=# VACUUM FULL pg_statistic => ERROR: missing chunk number 0 for toast value .. in pg_toast_2619

2018-05-25 Thread Justin Pryzby
On Sat, May 19, 2018 at 02:39:26PM -0400, Tom Lane wrote: > Justin Pryzby writes: > > [pryzbyj@database ~]$ while :; do for db in `psql postgres -Atc "SELECT > > datname FROM pg_database WHERE datallowconn"`; do for t in pg_statistic > > pg_attrdef pg_constraint; do echo "$db.$t..."; > > PGOPTI

RE: Insert data if it is not existing

2018-05-25 Thread Igor Neyman
From: tango ward [mailto:tangowar...@gmail.com] Sent: Thursday, May 24, 2018 8:16 PM To: Adrian Klaver Cc: David G. Johnston ; pgsql-generallists.postgresql.org Subject: Re: Insert data if it is not existing On Thu, May 24, 2018 at 9:38 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wro

Re: case statement within insert

2018-05-25 Thread David G. Johnston
On Friday, May 25, 2018, tango ward wrote: > > WHEN code like '%%PE%%' or code like '%%NSTP%%' > > I am getting TypeError: not all arguments converted during string > formatting. > > Any advice pls? > Unclear how to inject percent signs in the query string here. I'd just avoid them and

case statement within insert

2018-05-25 Thread tango ward
I want to insert data from mysql into a table in postgresql. I want to check when the subjectcode contains PE or NSTP so I can assign True or False to another column in destination DB. # Source data: # Source data: MySQL curr_msql.execute(''' SELECT code, subjectname