Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
knuxify
aports
Commits
f4f85656
Commit
f4f85656
authored
7 years ago
by
Eugene Pirogov
Committed by
Timo Teräs
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
testing/postgresql-pglogical: upgrade to 2.0.1
parent
e2f5f06c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testing/postgresql-pglogical/001-fix-stdin-handling.patch
+51
-0
51 additions, 0 deletions
testing/postgresql-pglogical/001-fix-stdin-handling.patch
testing/postgresql-pglogical/APKBUILD
+6
-5
6 additions, 5 deletions
testing/postgresql-pglogical/APKBUILD
with
57 additions
and
5 deletions
testing/postgresql-pglogical/001-fix-stdin-handling.patch
0 → 100644
+
51
−
0
View file @
f4f85656
diff --git a/pglogical_apply_spi.c b/pglogical_apply_spi.c
index 3eaccc4..111a4eb 100644
--- a/pglogical_apply_spi.c
+++ b/pglogical_apply_spi.c
@@ -454,7 +454,7 @@
static void
pglogical_proccess_copy(pglogical_copyState *pglcstate)
{
uint64 processed;
- FILE *save_stdin;
+ int save_stdin;
if (!pglcstate->copy_parsetree || !pglcstate->copy_buffered_tuples)
return;
@@ -489,8 +489,16 @@
pglogical_proccess_copy(pglogical_copyState *pglcstate)
* for this relation. Before that we save the current 'stdin' stream and
* restore it back when the COPY is done
*/
- save_stdin = stdin;
- stdin = pglcstate->copy_read_file;
+ save_stdin = dup(fileno(stdin));
+ if (save_stdin < 0)
+ ereport(FATAL,
+ (errcode_for_file_access(),
+ errmsg("could not save stdin: %m")));
+
+ if (dup2(fileno(pglcstate->copy_read_file), fileno(stdin)) < 0)
+ ereport(FATAL,
+ (errcode_for_file_access(),
+ errmsg("could not redirect stdin: %m")));
/* COPY may call into SPI (triggers, ...) and we already are in SPI. */
SPI_push();
@@ -501,10 +509,17 @@
pglogical_proccess_copy(pglogical_copyState *pglcstate)
/* Clean up SPI state */
SPI_pop();
+ /*
+ * Also close the read end of the pipe and restore 'stdin' to its original
+ * value
+ */
+ if (dup2(save_stdin, fileno(stdin)) < 0)
+ ereport(FATAL,
+ (errcode_for_file_access(),
+ errmsg("could not restore stdin: %m")));
fclose(pglcstate->copy_read_file);
pglcstate->copy_read_file = NULL;
- stdin = save_stdin;
/* Ensure we processed correct number of tuples */
Assert(processed == pglcstate->copy_buffered_tuples);
This diff is collapsed.
Click to expand it.
testing/postgresql-pglogical/APKBUILD
+
6
−
5
View file @
f4f85656
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Eugene Pirogov <iamexile@gmail.com>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname
=
postgresql-pglogical
pkgname
=
postgresql-pglogical
_pkgname
=
pglogical
_pkgname
=
pglogical
pkgver
=
1.2
.1
pkgver
=
2.0
.1
_pgver
=
9.6
_pgver
=
9.6
pkgrel
=
0
pkgrel
=
0
pkgdesc
=
"Logical Replication extension for PostgreSQL
$_pgver
"
pkgdesc
=
"Logical Replication extension for PostgreSQL
$_pgver
"
...
@@ -11,7 +12,8 @@ arch="all"
...
@@ -11,7 +12,8 @@ arch="all"
license
=
"custom"
license
=
"custom"
depends
=
"postgresql>=
$_pgver
.0"
depends
=
"postgresql>=
$_pgver
.0"
makedepends
=
"libedit-dev libxml2-dev postgresql-dev>=
$_pgver
.0 zlib-dev"
makedepends
=
"libedit-dev libxml2-dev postgresql-dev>=
$_pgver
.0 zlib-dev"
source
=
"http://packages.2ndquadrant.com/pglogical/tarballs/
$_pkgname
-
$pkgver
.tar.bz2"
source
=
"http://packages.2ndquadrant.com/pglogical/tarballs/
$_pkgname
-
$pkgver
.tar.bz2
001-fix-stdin-handling.patch"
builddir
=
"
$srcdir
/
$_pkgname
-
$pkgver
"
builddir
=
"
$srcdir
/
$_pkgname
-
$pkgver
"
build
()
{
build
()
{
...
@@ -24,6 +26,5 @@ package() {
...
@@ -24,6 +26,5 @@ package() {
make
USE_PGXS
=
1
DESTDIR
=
"
$pkgdir
"
install
make
USE_PGXS
=
1
DESTDIR
=
"
$pkgdir
"
install
}
}
md5sums
=
"ed339e8fc2f2252fc654a0d7072d7078 pglogical-1.2.1.tar.bz2"
sha512sums
=
"e1016484c06ce4a9466eb415ef5d0955b61c68c78e6fa47e84ec82ebef3979ac2eb83460f7c2262a9deac85cfdb365781d1784e8572a4efd5aae5aa3f8ea29db pglogical-2.0.1.tar.bz2
sha256sums
=
"409eea245b2cacdce6b357628da2b68cd322478582fcc4e2ff5feb954f9512c6 pglogical-1.2.1.tar.bz2"
89df4ed3992f43a0a37eebb5e06dedd2668b6acfad987b3c37e647c05718a9eb0d330d195f4f4426ffc5fad3e1fc7f156c10d3ea6dc7ee778bc2a5b27c6f138f 001-fix-stdin-handling.patch"
sha512sums
=
"0a613b2000f3a91e952e212232617a612b5439fb40a56d60646fc0665fb763e864f78cd91e0cc0b16cb5d6c202655ad2c9de872435fd6c185c5f849083915dca pglogical-1.2.1.tar.bz2"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment