Re: Promoting Hot standby after running select pg_xlog_replay_pause();

2020-03-27 Thread Jerry Sievers
"Bellrose, Brian" writes: > I have a scenario where we are doing an application release and they > want to be able to potentially rollback to HA if things go bad. So > the current process would be: > > > > 1. Run select pg_xlog_replay_pause(); on standby to pause > replication > 2. Apply

Re: \COPY to accept non UTF-8 chars in CHAR columns

2020-03-27 Thread Rory Campbell-Lange
On 27/03/20, Andrew Gierth (and...@tao11.riddles.org.uk) wrote: > > "Rory" == Rory Campbell-Lange writes: > > Rory> Or: > > Rory> iconv -f WINDOWS-1252 -t UTF-8 -c < tempfile2 > tempfile3 > > No. That's just a conversion of win1252 to utf8 without regard for any > UTF8 that might

Re: \COPY to accept non UTF-8 chars in CHAR columns

2020-03-27 Thread Andrew Gierth
> "Rory" == Rory Campbell-Lange writes: Rory> Or: Rory> iconv -f WINDOWS-1252 -t UTF-8 -c < tempfile2 > tempfile3 No. That's just a conversion of win1252 to utf8 without regard for any UTF8 that might already be present in the input. Any such input will end up double-encoded,

Re: \COPY to accept non UTF-8 chars in CHAR columns

2020-03-27 Thread Rory Campbell-Lange
On 27/03/20, Andrew Gierth (and...@tao11.riddles.org.uk) wrote: > > "Thomas" == Thomas Munro writes: > > Thomas> Something like this approach might be useful for fixing the CSV file: > > Thomas> >

Re: PG12 autovac issues

2020-03-27 Thread Justin King
On Fri, Mar 27, 2020 at 12:12 AM Michael Paquier wrote: > > On Thu, Mar 26, 2020 at 09:46:47AM -0500, Justin King wrote: > > Nope, it was just these tables that were looping over and over while > > nothing else was getting autovac'd. I'm happy to share the full log > > if you'd like. > > Thanks,

Re: \COPY to accept non UTF-8 chars in CHAR columns

2020-03-27 Thread Andrew Gierth
> "Thomas" == Thomas Munro writes: Thomas> Something like this approach might be useful for fixing the CSV file: Thomas> https://codereview.stackexchange.com/questions/185821/convert-a-mix-of-latin-1-and-utf-8-to-proper-utf-8 Or: perl -MEncode -pe ' use bytes; sub c {

Re: \COPY to accept non UTF-8 chars in CHAR columns

2020-03-27 Thread Thomas Munro
On Sat, Mar 28, 2020 at 4:46 AM Tom Lane wrote: > Matthias Apitz writes: > > In short, it there a way to let \COPY accept such broken ISO bytes, just > > complaining about, but not stopping the insert of the row? > > No. We don't particularly believe in the utility of invalid data. > > If you

Promoting Hot standby after running select pg_xlog_replay_pause();

2020-03-27 Thread Bellrose, Brian
I have a scenario where we are doing an application release and they want to be able to potentially rollback to HA if things go bad. So the current process would be: 1. Run select pg_xlog_replay_pause(); on standby to pause replication 2. Apply changes 3. If team needs to revert to

Re: PG12 autovac issues

2020-03-27 Thread Julien Rouhaud
On Fri, Mar 27, 2020 at 02:12:04PM +0900, Michael Paquier wrote: > On Thu, Mar 26, 2020 at 09:46:47AM -0500, Justin King wrote: > > Nope, it was just these tables that were looping over and over while > > nothing else was getting autovac'd. I'm happy to share the full log > > if you'd like. > >

Re: \COPY to accept non UTF-8 chars in CHAR columns

2020-03-27 Thread Tom Lane
Matthias Apitz writes: > In short, it there a way to let \COPY accept such broken ISO bytes, just > complaining about, but not stopping the insert of the row? No. We don't particularly believe in the utility of invalid data. If you don't actually care about what encoding your data is in, you

\COPY to accept non UTF-8 chars in CHAR columns

2020-03-27 Thread Matthias Apitz
Hello, We're moving databases from Sybase/Oracle to PostgreSQL 11.4 by unloading them with our own tool into a CSV like format and loading the rows with \COPY. One can imagine that in old databases, in use for a longer time, you will find any sort of dust which should not be there, for example

Re: Issue with Postgres process startup after instance restart

2020-03-27 Thread Tom Lane
Shishir Joshi writes: > I recently faced an issue with PG 11 where the VM that the PG process was > running on got restarted because of a hardware issue. After the VM restart, > the Postgres process failed to start on the 1st attempt with the error "*LOG: > could not open directory

Issue with Postgres process startup after instance restart

2020-03-27 Thread Shishir Joshi
Hello, I recently faced an issue with PG 11 where the VM that the PG process was running on got restarted because of a hardware issue. After the VM restart, the Postgres process failed to start on the 1st attempt with the error "*LOG: could not open directory "pg_tblspc/16388/PG_11_201809051": No

Re: How can I recreate a view in a new schema such that the view def references tables in the new schema ?

2020-03-27 Thread Laurenz Albe
On Thu, 2020-03-26 at 13:16 -0400, David Gauthier wrote: > psql (9.6.7, server 11.3) on linux > > I have 2 DBs, differnet servers/instances. I want to take all the metadata > and data for a set of tables/views > in the public schema of one DB and move it all over to be inside a schema of > a