diff --git a/.gitignore b/.gitignore
index c2072a8..53079aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-SOURCES/postgresql-10.10.tar.bz2
-SOURCES/postgresql-12.1-US.pdf
-SOURCES/postgresql-12.1.tar.bz2
+SOURCES/postgresql-10.15.tar.bz2
+SOURCES/postgresql-12.5-US.pdf
+SOURCES/postgresql-12.5.tar.bz2
 SOURCES/postgresql-setup-8.4.tar.gz
diff --git a/.postgresql.metadata b/.postgresql.metadata
index 01a9d5a..cadebb8 100644
--- a/.postgresql.metadata
+++ b/.postgresql.metadata
@@ -1,4 +1,4 @@
-388b082ea05e385f42ce1521f1a9f7d11561227b SOURCES/postgresql-10.10.tar.bz2
-e20c4ef3caebd2f6aa1d4ad448eaba6f786baf26 SOURCES/postgresql-12.1-US.pdf
-b9bd13230fa02a4d0105e92d15d56e7842119e26 SOURCES/postgresql-12.1.tar.bz2
+3d688f05d2de7c9ed89ef6be8d33906a4e7a833d SOURCES/postgresql-10.15.tar.bz2
+b6896c2b2d6064ba0c0d8803b4c795296c29cd6c SOURCES/postgresql-12.5-US.pdf
+031c42b26df6aa91351c02c336b9aa6111bf6c7e SOURCES/postgresql-12.5.tar.bz2
 f2112500abf4365fe968f1a7983fe174cca9e6f9 SOURCES/postgresql-setup-8.4.tar.gz
diff --git a/SOURCES/postgresql-10.10.tar.bz2.sha256 b/SOURCES/postgresql-10.10.tar.bz2.sha256
deleted file mode 100644
index 7ab50b6..0000000
--- a/SOURCES/postgresql-10.10.tar.bz2.sha256
+++ /dev/null
@@ -1 +0,0 @@
-ad4f9b8575f98ed6091bf9bb2cb16f0e52795a5f66546c1f499ca5c69b21f253  postgresql-10.10.tar.bz2
diff --git a/SOURCES/postgresql-10.15.tar.bz2.sha256 b/SOURCES/postgresql-10.15.tar.bz2.sha256
new file mode 100644
index 0000000..a59a1a2
--- /dev/null
+++ b/SOURCES/postgresql-10.15.tar.bz2.sha256
@@ -0,0 +1 @@
+5956bce0becffa77883c41594c95a23110b94f10cd66a1157e373c3575921f7e  postgresql-10.15.tar.bz2
diff --git a/SOURCES/postgresql-12.1.tar.bz2.sha256 b/SOURCES/postgresql-12.1.tar.bz2.sha256
deleted file mode 100644
index 27f8f97..0000000
--- a/SOURCES/postgresql-12.1.tar.bz2.sha256
+++ /dev/null
@@ -1 +0,0 @@
-a09bf3abbaf6763980d0f8acbb943b7629a8b20073de18d867aecdb7988483ed  postgresql-12.1.tar.bz2
diff --git a/SOURCES/postgresql-12.5.tar.bz2.sha256 b/SOURCES/postgresql-12.5.tar.bz2.sha256
new file mode 100644
index 0000000..7e7febf
--- /dev/null
+++ b/SOURCES/postgresql-12.5.tar.bz2.sha256
@@ -0,0 +1 @@
+bd0d25341d9578b5473c9506300022de26370879581f5fddd243a886ce79ff95  postgresql-12.5.tar.bz2
diff --git a/SOURCES/postgresql-man.patch b/SOURCES/postgresql-man.patch
index 8d3afe3..d231f47 100644
--- a/SOURCES/postgresql-man.patch
+++ b/SOURCES/postgresql-man.patch
@@ -6,18 +6,6 @@ RHBZ#948933).
 diff -up ./doc/src/sgml/man1/ecpg.1.man948933 ./doc/src/sgml/man1/ecpg.1
 --- ./doc/src/sgml/man1/ecpg.1.man948933	2014-12-16 02:13:15.000000000 +0100
 +++ ./doc/src/sgml/man1/ecpg.1	2014-12-23 11:26:37.883644047 +0100
-@@ -80,6 +80,11 @@ INFORMIX_SE\&.
- Define a C preprocessor symbol\&.
- .RE
- .PP
-+\fB\-h \fR
-+.RS 4
-+Parse a header file, this option includes option \fB\-c\fR\&.
-+.RE
-+.PP
- \fB\-i\fR
- .RS 4
- Parse system include files as well\&.
 @@ -128,6 +133,11 @@ Allow question mark as placeholder for c
  .RE
  .RE
diff --git a/SPECS/postgresql.spec b/SPECS/postgresql.spec
index b77390c..1ac01be 100644
--- a/SPECS/postgresql.spec
+++ b/SPECS/postgresql.spec
@@ -59,8 +59,8 @@
 Summary: PostgreSQL client programs
 Name: postgresql
 %global majorversion 12
-Version: %{majorversion}.1
-Release: 2%{?dist}
+Version: %{majorversion}.5
+Release: 1%{?dist}
 
 # The PostgreSQL license is very similar to other MIT licenses, but the OSI
 # recognizes it as an independent license, so we do as well.
@@ -71,8 +71,8 @@ Url: http://www.postgresql.org/
 # in-place upgrade of an old database.  In most cases it will not be critical
 # that this be kept up with the latest minor release of the previous series;
 # but update when bugs affecting pg_dump output are fixed.
-%global prevversion 10.10
 %global prevmajorversion 10
+%global prevversion %{prevmajorversion}.15
 %global prev_prefix %{_libdir}/pgsql/postgresql-%{prevmajorversion}
 %global precise_version %{?epoch:%epoch:}%version-%release
 
@@ -108,6 +108,7 @@ Patch5: postgresql-var-run-socket.patch
 Patch6: postgresql-man.patch
 Patch8: postgresql-external-libpq.patch
 Patch9: postgresql-server-pg_config.patch
+# Patch10: postgresql-12.5-contrib-dblink-expected-out.patch
 
 BuildRequires: gcc
 BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex gawk
@@ -368,6 +369,7 @@ benchmarks.
 %patch6 -p1
 %patch8 -p1
 %patch9 -p1
+# %%patch10 -p1
 
 # We used to run autoconf here, but there's no longer any real need to,
 # since Postgres ships with a reasonably modern configure script.
@@ -1218,6 +1220,15 @@ make -C postgresql-setup-%{setup_version} check
 
 
 %changelog
+* Tue Nov 17 2020 Patrik Novotný <panovotn@redhat.com> - 12.5-1
+- Rebase to upstream release 12.5
+  Resolves: rhbz#1901555
+  Resolves: rhbz#1898223
+  Resolves: rhbz#1898329
+
+* Tue Nov 26 2019 Patrik Novotný <panovotn@redhat.com> - 12.1-3
+- Release bump for 8.2.0 BZ#1776805
+
 * Tue Nov 19 2019 Patrik Novotný <panovotn@redhat.com> - 12.1-2
 - Release bump for rebuild against libpq-12.1-3