You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a data directory that I initialized with initdb. When I try to run the example connecting to that data directory, the Promise returned by db.query(...) never resolves. Here's the code:
import{PGlite}from"@electric-sql/pglite";constdb=newPGlite("./pgdata");awaitdb.waitReady;constresult=awaitdb.query("select 'Hello world' as message;");console.log(result);awaitdb.close();
EDIT: I just realized that this is most likely because there is a difference in the version of postgres that created the dbs:
// created by installed initdb command on my machine
PostgreSQL 16.0 on aarch64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.102), 64-bit
// created by pglite
PostgreSQL 15devel on aarch64-apple-darwin22.6.0, compiled by emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.25 (febd44b21ecaca86e2cb2a25ef3ed4a0a2076365), 32-bit
It would be nice to include an error for this type of thing. Are there plans for this to be resolved?
The text was updated successfully, but these errors were encountered:
Hey, yep, PGlite is using v15 and there is no compatibility between major pg versions data stores. We need to improve error handling in this situation.
thanks for the report.
samwillis
changed the title
Query never resolves with pgdata directory created with initdb
Validate that dbdata dir is of the correct PG version when starting.
Feb 27, 2024
I have a data directory that I initialized with
initdb
. When I try to run the example connecting to that data directory, the Promise returned bydb.query(...)
never resolves. Here's the code:EDIT: I just realized that this is most likely because there is a difference in the version of postgres that created the dbs:
It would be nice to include an error for this type of thing. Are there plans for this to be resolved?
The text was updated successfully, but these errors were encountered: