error: relation "snapshots" does not exist
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, postgresql
- Domain
- database
Research direction
Start with the rich-text-presence example and its PostgreSQL setup, then compare the database and schema used by the running example with the SQL that creates ops and snapshots. Reproduce the error and confirm that the example starts without the relation "snapshots" error.
Written by the indexing model from the issue text.
Description
Hi,
I keep getting this error even after creating all the tables snapshots and ops from the script provided.
CREATE TABLE IF NOT EXISTS ops (
collection character varying(255) not null,
doc_id character varying(255) not null,
version integer not null,
operation jsonb not null, -- {v:0, create:{...}} or {v:n, op:[...]}
PRIMARY KEY (collection, doc_id, version)
);
CREATE TABLE IF NOT EXISTS snapshots (
collection character varying(255) not null,
doc_id character varying(255) not null,
doc_type character varying(255) not null,
version integer not null,
data jsonb not null,
PRIMARY KEY (collection, doc_id)
);
error: relation "snapshots" does not exist
at Parser.parseErrorMessage (/Users/../workspace/colaboration-demos/sharedb/examples/rich-text-presence/node_modules/pg-protocol/dist/parser.js:283:98)
at Parser.handlePacket (/Users/../workspace/colaboration-demos/sharedb/examples/rich-text-presence/node_modules/pg-protocol/dist/parser.js:122:29)
at Parser.parse (/Users/../workspace/colaboration-demos/sharedb/examples/rich-text-presence/node_modules/pg-protocol/dist/parser.js:35:38)
at Socket.<anonymous> (/Users/../workspace/colaboration-demos/sharedb/examples/rich-text-presence/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:520:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
- Dominant language
- JavaScript
- Stars
- 49
- Forks
- 22
- Avg merge
- 6h 11m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from share/sharedb-postgres
-
Support Queries Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
share/sharedb-postgres#17 ·
All issues in share/sharedb-postgres
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·