Re: [GENERAL] Replication slot and pg_rewind

2017-06-05 Thread Michael Paquier
On Tue, Jun 6, 2017 at 1:52 PM, Bhattacharyya, Subhro wrote: > Our expectation is that slave will be able to sync with the new master with > the help of whatever WALs are present in the new master due to replication > slots. > Can pg_rewind still work without WAL

Re: [GENERAL] Replication slot and pg_rewind

2017-06-05 Thread Bhattacharyya, Subhro
Our cluster works as follows: We do not promote the slave while the primary is up. During an update scenario, when the master goes down the slave is promoted to master only if there is no replication lag. As a result, we do not have any data difference till now. Transactions now continue on

Re: [GENERAL] Replication slot and pg_rewind

2017-06-05 Thread Michael Paquier
On Tue, Jun 6, 2017 at 12:03 PM, Bhattacharyya, Subhro wrote: > We are using the replication slot and pg_rewind feature of postgresql 9.6 > Our cluster consists of 1 master and 1 slave node. > > The replication slot feature allows the master to keep as much WAL as is >

[GENERAL] Replication slot and pg_rewind

2017-06-05 Thread Bhattacharyya, Subhro
We are using the replication slot and pg_rewind feature of postgresql 9.6 Our cluster consists of 1 master and 1 slave node. The replication slot feature allows the master to keep as much WAL as is required by the slave. The pg_rewind command uses WALs to bring the slave in sync with the

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Adrian Klaver
On 06/05/2017 05:59 PM, Ken Tanzer wrote: Not sure why just know that if I stay within the guidelines it works, if I do not its does not work:) That's fair enough, leaving aside the curiosity part. Usually though the things you can't do just aren't allowed. It's easier to

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Ken Tanzer
> > > So I can switch to Custom format for future backups. But regarding the > > existing backups I have in Tar format, is there any way to successfully > > restore them? > > FWIW, the business with making and editing a list file should work just > fine with a tar-format dump, not only with a

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Tom Lane
Ken Tanzer writes: > ...The rest of the DB is fine, but tbl_payment has 0 rows. I believe this is > because tbl_payment has a constraint that calls a function has_perm() that > relies on data in a couple of other tables, and that tbl_payment is being > restored before those

Re: [GENERAL] Unable to install EASM postgre due to error 8023

2017-06-05 Thread Scott Mead
On Mon, Jun 5, 2017 at 9:59 PM, Garry Sim wrote: > Hi Scott, > > > > Is there a difference between postgre and Entrust Authority Security > Manager Postgresql Database? But even if end of support, anyway of letting > me have a better understanding of the error code ? >

Re: [GENERAL] Unable to install EASM postgre due to error 8023

2017-06-05 Thread Scott Mead
On Mon, Jun 5, 2017 at 6:14 AM, Garry Sim wrote: > Hi all, > > > > I did a search but unable to find anything in regards to this error. I am > installing “01 SM_81SP1_Win_PostgreSQL_8323_setup.exe” but upon > installing towards the ending, I am encountering this message.

[GENERAL] Unable to install EASM postgre due to error 8023

2017-06-05 Thread Garry Sim
Hi all, I did a search but unable to find anything in regards to this error. I am installing “01 SM_81SP1_Win_PostgreSQL_8323_setup.exe” but upon installing towards the ending, I am encountering this message. “Modifying the database files failed with an exit code of 8023”. I am currently

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread David G. Johnston
On Mon, Jun 5, 2017 at 6:21 PM, Ken Tanzer wrote: > I do get the "make \d show relevant information" argument and that is one >> that seems easier to solve... >> > > Maybe I'm missing something, but I'm not sure how you'd solve this or > change what \d shows for a table.

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Ken Tanzer
> > I do get the "make \d show relevant information" argument and that is one > that seems easier to solve... > Maybe I'm missing something, but I'm not sure how you'd solve this or change what \d shows for a table. Right now I get to see this in my \d: "authorized_approvers_only" CHECK

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread David G. Johnston
On Mon, Jun 5, 2017 at 5:59 PM, Ken Tanzer wrote: > I can't really make this an FK. I can (and probably will) put this into a >>> trigger. Although it seems like an extra layer of wrapping just to call a >>> function. I'm curious if there's any conceptual reason why

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Ken Tanzer
> > I can't really make this an FK. I can (and probably will) put this into a >> trigger. Although it seems like an extra layer of wrapping just to call a >> function. I'm curious if there's any conceptual reason why constraints >> couldn't (as an option) be restored after all the data is

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Adrian Klaver
On 06/05/2017 05:15 PM, Ken Tanzer wrote: Thanks Adrian and David. That all makes sense, and I gather the answer regarding the existing dumps is "no, they can't be restored." So be it. Here's a couple of follow-on comments:: Ideally figure out how to write an actual FK constraint -

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread John R Pierce
On 6/5/2017 5:49 PM, David G. Johnston wrote: On Mon, Jun 5, 2017 at 5:40 PM, John R Pierce >wrote: ​i​ ndeed, any sort of constraint that invokes a function call which looks at other tables could later be invalidated if those other

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread David G. Johnston
On Mon, Jun 5, 2017 at 5:40 PM, John R Pierce wrote: > ​i​ > ndeed, any sort of constraint that invokes a function call which looks at > other tables could later be invalidated if those other tables change, and > postgres would be none the smarter. the same goes for

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Ken Tanzer
> > Aside from being a bit more verbose there is nothing useful that writing > this as "CHECK function()" provides that you don't also get by writing > "CREATE TRIGGER". > I agree you get the same result. It may be a minor issue, but for me it is convenient to see the logic spelled out when

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread John R Pierce
On 6/5/2017 5:32 PM, David G. Johnston wrote: On Mon, Jun 5, 2017 at 5:15 PM, Ken Tanzer >wrote: From the docs: https://www.postgresql.org/docs/9.6/static/sql-createtable.html

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread David G. Johnston
On Mon, Jun 5, 2017 at 5:15 PM, Ken Tanzer wrote: > From the docs: >> https://www.postgresql.org/docs/9.6/static/sql-createtable.html >> "Currently, CHECK expressions cannot contain subqueries nor refer to >> variables other than columns of the current row. The system

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread John R Pierce
On 6/5/2017 5:15 PM, Ken Tanzer wrote: I can't really make this an FK. I can (and probably will) put this into a trigger. Although it seems like an extra layer of wrapping just to call a function. I'm curious if there's any conceptual reason why constraints couldn't (as an option) be

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Ken Tanzer
Thanks Adrian and David. That all makes sense, and I gather the answer regarding the existing dumps is "no, they can't be restored." So be it. Here's a couple of follow-on comments:: Ideally figure out how to write an actual FK constraint - otherwise use > triggers. I can't really make this

Re: [GENERAL] Redo the filenode link in tablespace

2017-06-05 Thread Adrian Klaver
On 06/05/2017 04:07 PM, tel medola wrote: Hi, attachment. select: select * from pg_class where relfilenode = 5214489 Next, what do you get from: In psql => \x Expanded display is on. select oid, * from pg_class where oid = 5214493; No need to create an attachment, just cut and paste into

Re: [GENERAL] Redo the filenode link in tablespace

2017-06-05 Thread tel medola
Hi, attachment. select: select * from pg_class where relfilenode = 5214489 Thanks 2017-06-05 16:02 GMT-03:00 Adrian Klaver : > On 06/05/2017 11:55 AM, tel medola wrote: > >> show? >> /Yes/ >> > > Yes, what? > > Please run the command as shown: > > select * from

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Adrian Klaver
On 06/05/2017 03:35 PM, Ken Tanzer wrote: On 9.3.17, I tried to restore a tar from pg_dump. It failed thusly: bash-4.1$ pg_restore -d spc_test_1 agency_backup.spc.2017.06.05_10.30.01.tar pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry

Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread David G. Johnston
On Mon, Jun 5, 2017 at 3:35 PM, Ken Tanzer wrote: > I believe this is because tbl_payment has a constraint that calls a > function has_perm() that relies on data in a couple of other tables > ​Indeed this is the cause. That configuration is not supported. If you need to

[GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

2017-06-05 Thread Ken Tanzer
On 9.3.17, I tried to restore a tar from pg_dump. It failed thusly: bash-4.1$ pg_restore -d spc_test_1 agency_backup.spc.2017.06.05_10.30.01.tar pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 10608; 0 107743 TABLE DATA tbl_payment spc

Re: [GENERAL] Redo the filenode link in tablespace

2017-06-05 Thread tel medola
I will send as soon as possible. He's running the vacuum yet. 2017-06-05 16:02 GMT-03:00 Adrian Klaver : > On 06/05/2017 11:55 AM, tel medola wrote: > >> show? >> /Yes/ >> > > Yes, what? > > Please run the command as shown: > > select * from pg_class where relfilenode

Re: [GENERAL] Redo the filenode link in tablespace

2017-06-05 Thread Adrian Klaver
On 06/05/2017 11:55 AM, tel medola wrote: show? /Yes/ Yes, what? Please run the command as shown: select * from pg_class where relfilenode = 5214489; and show the result. Do not delete the pg_statistic table. I would not even delete from it. /Sorry, I already deleted it. I looked for

Re: [GENERAL] Redo the filenode link in tablespace

2017-06-05 Thread tel medola
show? *Yes* Do not delete the pg_statistic table. I would not even delete from it. *Sorry, I already deleted it. I looked for something official and found in the site in postgres the reference that the delete could be done (https://www.postgresql.org/docs/9.1/static/release-7-4-2.html

Re: [GENERAL] Redo the filenode link in tablespace

2017-06-05 Thread Adrian Klaver
On 06/05/2017 07:17 AM, tel medola wrote: Done. I followed the steps below after reconnecting the filenode: Select * from "05122016".repositorio Count -> 0 Then, I execute the commands: Analyze "05122016".repositorio; Count -> 0 Reindex "05122016".repositorio; Count -> 1509046 Yes! But...

Re: [GENERAL] Redo the filenode link in tablespace

2017-06-05 Thread tel medola
Done. I followed the steps below after reconnecting the filenode: Select * from "05122016".repositorio Count -> 0 Then, I execute the commands: Analyze "05122016".repositorio; Count -> 0 Reindex "05122016".repositorio; Count -> 1509046 Yes! But... select * from "05122016".repository where

Re: [GENERAL] Redo the filenode link in tablespace

2017-06-05 Thread tel medola
Sorry. I got sick these days and could not read my emails. Thanks for your help. I'll try to point to the direct node and see what happens. 2017-06-01 10:29 GMT-03:00 Adrian Klaver : > On 06/01/2017 03:47 AM, tel medola wrote: > >> Did you get any help with this? >>

Re: [GENERAL] Oracle database into PostgreSQL using Ora2PG tool.

2017-06-05 Thread PAWAN SHARMA
On Sat, Jun 3, 2017 at 1:48 AM, Igor Neyman wrote: > > I wonder, does plpgsql compilation check for existence of the > add_job_history function or is that a runtime check? > > > > At runtime. > > Hi