Re: [GENERAL] Slony error please help

2016-07-17 Thread Jan Wieck
On Sun, Jul 17, 2016 at 12:47 AM, Jan Wieck  wrote:

>
> The only thing I can imagine would be that there is another slony cluster
> (or
> remnants of it) hanging around in the 9.4 installation, possibly in
> another database.
>
>
That does reproduce the problem. I ran the new doc/pgbench-tutorial through
steps
01, 02 and 03 with a 9.4/2.2.2 installation. Upgraded to 9.4/2.2.5 but left
out the
UPDATE FUNCTIONS for node 3. I could have created a fourth database and just
run INIT CLUSTER against that.

I then installed 9.5/2.2.5 in parallel and the pg_upgrade run looks like
this:

(venv)[postgres@db1 pgbench-tutorial]$ pg_upgrade -b
>> /var/lib/pgsql/test_94/bin -B /var/lib/pgsql/test_95/bin -d
>> /opt/pgsql/test_94 -D /opt/pgsql/test_95 -p 54394 -P 54395 -c
>
> Performing Consistency Checks
>
> -
>
> Checking cluster versions   ok
>
> Checking database user is the install user  ok
>
> Checking database connection settings   ok
>
> Checking for prepared transactions  ok
>
> Checking for reg* system OID user data typesok
>
> Checking for contrib/isn with bigint-passing mismatch   ok
>
> Checking for presence of required libraries fatal
>
>
>> Your installation references loadable libraries that are missing from the
>
> new installation.  You can add these libraries to the new installation,
>
> or remove the functions using them from the old installation.  A list of
>
> problem libraries is in the file:
>
> loadable_libraries.txt
>
>
>> Failure, exiting
>
> (venv)[postgres@db1 pgbench-tutorial]$ cat loadable_libraries.txt
>
> Could not load library "$libdir/slony1_funcs.2.2.2"
>
> ERROR:  could not access file "$libdir/slony1_funcs.2.2.2": No such file
>> or directory
>
>
>
If I drop the offending database or run UPDATE FUNCTIONS in it, pg_upgrade
is happy.


Regards, Jan

-- 
Jan Wieck
Senior Postgres Architect
http://pgblog.wi3ck.info


[GENERAL] pg_basebackup vs archive_command - looking for WAL archive older than archive_command start

2016-07-17 Thread Francisco Reyes

I turned on archive_command and have wal archiving going.

I did a pg_basebackup and copied the resulting file from source machine 
to target, yet when I restore I am getting


requested WAL segment 000508AE009B has already been removed

The earliest WAL archives I have are

000508D2005C.0028.backup.gz
000508D2005C.gz
000508D2005D.gz

Why is the pg_basebackup restore looking for a WAL file that is even 
older than the ones I have, when I turned on WAL archiving before I 
started the pg_basebackup?


Also, why is that one WAL archive named differently with .backup?

Normally I restore with pg_basebackup and streaming replication, which 
works well, but lately due to constant network disconnects I have to 
make the pg_basebackup in the source machine and rsync. That is why I 
turned on WAL archiving before starting the base backup since it would 
take some time to copy the base backup file over.


The command I am using to create the base backup is
pg_basebackup  -U UserName -h 127.0.0.1 -D - -P -Ft | gzip > 
Basebackup.tar.gz


Any suggestions?


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] pg_basebackup vs archive_command - looking for WAL archive older than archive_command start

2016-07-17 Thread Michael Paquier
On Mon, Jul 18, 2016 at 7:35 AM, Francisco Reyes  wrote:
> I turned on archive_command and have wal archiving going.
>
> I did a pg_basebackup and copied the resulting file from source machine to
> target, yet when I restore I am getting
>
> requested WAL segment 000508AE009B has already been removed

This is decided by the backup_label file located in the backup

> The earliest WAL archives I have are
>
> 000508D2005C.0028.backup.gz
> 000508D2005C.gz
> 000508D2005D.gz
>
> Why is the pg_basebackup restore looking for a WAL file that is even older
> than the ones I have, when I turned on WAL archiving before I started the
> pg_basebackup?
>
> Also, why is that one WAL archive named differently with .backup?

This gives an indication where a backup has been taken. Depending on
the situation, like node promotion, there could be as well timeline
history files.

> Any suggestions?

It seems to me that you do not retain enough history, or simply that
you did not turn on WAL archiving before taking the base backup.. In
the current situation and you don't have those segments, the backup
you took is likely useless. It may not be able to reach a consistent
state.
-- 
Michael


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Re: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start

2016-07-17 Thread Francisco Reyes

On 07/17/2016 06:35 PM, Francisco Reyes wrote:


Why is the pg_basebackup restore looking for a WAL file that is even 
older than the ones I have, when I turned on WAL archiving before I 
started the pg_basebackup?


Figured it out.. the error is from a secondary slave trying to sync from 
the machine I just restored the pg_basebackup.




Also, why is that one WAL archive named differently with .backup?


Still would be nice to know the above..


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Re: pg_basebackup vs archive_command - looking for WAL archive older than archive_command start

2016-07-17 Thread Adrian Klaver

On 07/17/2016 04:03 PM, Francisco Reyes wrote:

On 07/17/2016 06:35 PM, Francisco Reyes wrote:


Why is the pg_basebackup restore looking for a WAL file that is even
older than the ones I have, when I turned on WAL archiving before I
started the pg_basebackup?


Figured it out.. the error is from a secondary slave trying to sync from
the machine I just restored the pg_basebackup.



Also, why is that one WAL archive named differently with .backup?


Still would be nice to know the above..




https://www.postgresql.org/docs/9.5/static/continuous-archiving.html

24.3.2. Making a Base Backup



--
Adrian Klaver
adrian.kla...@aklaver.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Reset stats - Pg 9.2

2016-07-17 Thread Patrick B
Hi all,
>
>
> select stats_reset from pg_stat_database;


It says the statistics were reseted back in 2014.

I want to reset it now (production database), to get more clear data.

select pg_stat_reset();


Should be ok? Those stats aren't used for Query plan, right?

Thanks
Patrick


Re: [GENERAL] Reset stats - Pg 9.2

2016-07-17 Thread Adrian Klaver

On 07/17/2016 08:08 PM, Patrick B wrote:

Hi all,


select stats_reset from pg_stat_database;


It says the statistics were reseted back in 2014.

I want to reset it now (production database), to get more clear data.

select pg_stat_reset();


Should be ok? Those stats aren't used for Query plan, right?


That would be pg_statistic:

https://www.postgresql.org/docs/9.2/static/catalog-pg-statistic.html



Thanks
Patrick



--
Adrian Klaver
adrian.kla...@aklaver.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general