forked from electric-sql/pglite
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
174 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
patches/postgresql-wasm-16.4/src-bin-pg_dump-parallel.c.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- postgresql/src/bin/pg_dump/parallel.c | ||
+++ postgresql-wasm/src/bin/pg_dump/parallel.c | ||
@@ -49,7 +49,7 @@ | ||
* The pstate->te[] entry for each worker is valid when it's in WRKR_WORKING | ||
* state, and must be NULL in other states. | ||
*/ | ||
- | ||
+#define PG_DUMP_PARALLEL | ||
#include "postgres_fe.h" | ||
|
||
#ifndef WIN32 | ||
@@ -445,6 +445,7 @@ | ||
static void | ||
WaitForTerminatingWorkers(ParallelState *pstate) | ||
{ | ||
+#if !defined(__wasi__) | ||
while (!HasEveryWorkerTerminated(pstate)) | ||
{ | ||
ParallelSlot *slot = NULL; | ||
@@ -504,6 +505,7 @@ | ||
slot->workerStatus = WRKR_TERMINATED; | ||
pstate->te[j] = NULL; | ||
} | ||
+#endif /* __wasi__ */ | ||
} | ||
|
||
|
18 changes: 18 additions & 0 deletions
18
patches/postgresql-wasm-16.4/src-bin-pg_upgrade-parallel.c.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- postgresql/src/bin/pg_upgrade/parallel.c | ||
+++ postgresql-wasm/src/bin/pg_upgrade/parallel.c | ||
@@ -277,6 +277,7 @@ | ||
bool | ||
reap_child(bool wait_for_child) | ||
{ | ||
+#if !defined(__wasi__) | ||
#ifndef WIN32 | ||
int work_status; | ||
pid_t child; | ||
@@ -336,6 +337,6 @@ | ||
|
||
/* do this after job has been removed */ | ||
parallel_jobs--; | ||
- | ||
+#endif /* __wasi__ */ | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- postgresql/src/bin/psql/command.c | ||
+++ postgresql-wasm/src/bin/psql/command.c | ||
@@ -5146,6 +5146,10 @@ | ||
static bool | ||
do_watch(PQExpBuffer query_buf, double sleep, int iter) | ||
{ | ||
+#if defined(__wasi__) | ||
+ pg_log_error("#5150 wasi: could not set timer"); | ||
+ return false; | ||
+#else | ||
long sleep_ms = (long) (sleep * 1000); | ||
printQueryOpt myopt = pset.popt; | ||
const char *strftime_fmt; | ||
@@ -5384,6 +5388,7 @@ | ||
|
||
pg_free(title); | ||
return (res >= 0); | ||
+#endif /* __wasi__ */ | ||
} | ||
|
||
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- postgresql/src/fe_utils/print.c | ||
+++ postgresql-wasm/src/fe_utils/print.c | ||
@@ -15,6 +15,7 @@ | ||
* | ||
*------------------------------------------------------------------------- | ||
*/ | ||
+#define FE_UTILS_PRINT | ||
#include "postgres_fe.h" | ||
|
||
#include <limits.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters