Etherpad-lite: Postgres ๋ฐฑ์—”๋“œ-์˜ค๋ฅ˜ : "๊ฐ’"์—ด์€ jsonb ์œ ํ˜•์ด์ง€๋งŒ ํ‘œํ˜„์‹์€ ํ…์ŠคํŠธ ์œ ํ˜•์ž…๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2020๋…„ 09์›” 08์ผ  ยท  29์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: ether/etherpad-lite

๋ฒ„๊ทธ ์„ค๋ช…
๋ชจ๋“  ์ข…๋ฅ˜์˜ ์‚ฝ์ž…์„ ์ˆ˜ํ–‰ ํ•  ๋•Œ ์Šคํ‚ค๋งˆ๊ฐ€ ์ผ์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์˜ค๋ฅ˜ : "๊ฐ’"์—ด์€ jsonb ์œ ํ˜•์ด์ง€๋งŒ ํ‘œํ˜„์‹์€ ํ…์ŠคํŠธ ์œ ํ˜•์ž…๋‹ˆ๋‹ค.

์žฌํ˜„ํ•˜๋ ค๋ฉด
์ตœ์‹  ์†Œ์Šค ๋ฐ postgres๋ฅผ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค. v12 ๋ฐ v13์œผ๋กœ ์‹œ๋„ํ–ˆ์Šต๋‹ˆ๋‹ค.

์˜ˆ์ƒ๋˜๋Š” ํ–‰๋™
์˜ค๋ฅ˜์—†์ด ์‚ฝ์ž…์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

์Šคํฌ๋ฆฐ ์ƒท
etherpad_1 | [2020-09-08 20 : 37 : 50.541] [์˜ค๋ฅ˜] ์ฝ˜์†”-์˜ค๋ฅ˜ : '๊ฐ’'์—ด์€ jsonb ์œ ํ˜•์ด์ง€๋งŒ ํ‘œํ˜„์‹์€ ํ…์ŠคํŠธ ์œ ํ˜•์ž…๋‹ˆ๋‹ค.
etherpad_1 | Parser.parseErrorMessage (/opt/etherpad-lite/src/node_modules/pg-protocol/dist/parser.js:278:15)
etherpad_1 | Parser.handlePacket (/opt/etherpad-lite/src/node_modules/pg-protocol/dist/parser.js:126:29)
etherpad_1 | Parser.parse (/opt/etherpad-lite/src/node_modules/pg-protocol/dist/parser.js:39:38)
etherpad_1 | Socket.stream.on (/opt/etherpad-lite/src/node_modules/pg-protocol/dist/index.js:8:42)
etherpad_1 | Socket.emit (events.js : 198 : 13)
etherpad_1 | Socket.EventEmitter.emit (domain.js : 448 : 20)
etherpad_1 | addChunk์—์„œ (_stream_readable.js : 288 : 12)
etherpad_1 | readableAddChunk (_stream_readable.js : 269 : 11)
etherpad_1 | Socket.Readable.push (_stream_Readable.js : 224 : 10)
etherpad_1 | at TCP.onStreamRead [as onread] (internal / stream_base_commons.js : 94 : 17)

๋ฐ์Šคํฌํƒ‘ (๋‹ค์Œ ์ •๋ณด๋ฅผ ์ž‘์„ฑํ•˜์‹ญ์‹œ์˜ค) :
NA

์Šค๋งˆํŠธ ํฐ (๋‹ค์Œ ์ •๋ณด๋ฅผ ์ž‘์„ฑํ•˜์‹ญ์‹œ์˜ค) :
NA

์ถ”๊ฐ€ ์ปจํ…์ŠคํŠธ
์ด๊ฒƒ์€ ๋„์ปค ์ปจํ…Œ์ด๋„ˆ๋กœ ํ…Œ์ŠคํŠธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Serious Bug

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค @JohnMcLear , ๋‹ค์Œ์„ ์‹คํ–‰ํ•˜๋ฉด ๋‹ค์‹œ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.

alter table "store" alter column "value" type text;

๋ชจ๋“  29 ๋Œ“๊ธ€

์ด๊ฒƒ์€ ๋Œ€๋ถ€๋ถ„ ๋ฆด๋ฆฌ์Šค๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•  ๋•Œ ์ตœ์‹  ์†Œ์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฌธ์ œ์ž…๋‹ˆ๋‹ค.

๋‚˜๋Š” 1.8.4๋กœ ์ด๊ฒƒ์„ ์‹œ๋„ ํ–ˆ์œผ๋ฉฐ์ด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š”๋‹ค๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ์— ๋”ฐ๋ผ ๋ฌธ์ œ๋ฅผ ์—…๋ฐ์ดํŠธํ–ˆ์Šต๋‹ˆ๋‹ค.

1.8.5๋ฅผ ์ œ์™ธํ•˜๊ณ ๋Š”์ด ๋ฒ„๊ทธ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

c8361a211a1e6bfbbc006933f48d48ca51857c71์—์„œ ์ˆ˜์ • ๋จ

c8361a2 ์—์„œ ์ˆ˜์ •

๋‚˜๋Š” ์•„์ง๋„ ๊ทธ๊ฒƒ์„ ์–ป๋Š”๋‹ค.

image

git pull ๋‹ค์Œ bin / run.sh ํ–ˆ์Šต๋‹ˆ๊นŒ?

ueber๋ฅผ ์—…๋ฐ์ดํŠธํ•ด์•ผํ•˜๋ฉฐ bin / run.sh๊ฐ€์ด๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ๋น ๋ฅธ ์‹คํ–‰์„ ์‚ฌ์šฉํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค

์˜ˆ, ์ €๋Š” ํ•ญ์ƒ bin/run.sh ํ•ฉ๋‹ˆ๋‹ค.
"ueberdb2": "^0.5.2" ๋กœ ์—…๋ฐ์ดํŠธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Screenshot_20200910_103721

ํ…Œ์ŠคํŠธ๋Š” ์ž˜ ํ†ต๊ณผํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ƒˆ๋กœ์šด pg dB plz๋ฅผ ์‹œ๋„ํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ์ด์ „ ์ปค๋ฐ‹์ด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์†์ƒํ–ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

์ƒˆ๋กœ์šด pg dB plz๋ฅผ ์‹œ๋„ํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ์ด์ „ ์ปค๋ฐ‹์ด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์†์ƒํ–ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

๋ฌผ๋ก ์ž…๋‹ˆ๋‹ค.

์ƒˆ๋กœ์šด pg dB plz๋ฅผ ์‹œ๋„ํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ์ด์ „ ์ปค๋ฐ‹์ด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์†์ƒํ–ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

์‹ค์ œ๋กœ ๋‚ด ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์œผ๋กœ ์ธํ•ด ๋ชจ๋“  ๋นŒ๋“œ์—์„œ ์ƒˆ๋กœ์šด pg db๋ฅผ ์–ป๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
image
image

๊ทธ๋Ÿฐ ๋‹ค์Œ ueberdb ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•ด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•์„ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด Travis ๊ตฌ์„ฑ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ๊ฐ€ ์•„๋‹Œ ueber dB repo๋ฅผ ์›ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์•„๋ž˜ ์ €์žฅ์†Œ๋ฅผ ์‚ฌ์šฉํ•ด์•ผํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๊นŒ?
https://github.com/ether/ueberDB#dirtyref

dirtyref๋Š” ๋งˆ์Šคํ„ฐ๋กœ ๋ณ‘ํ•ฉ๋ฉ๋‹ˆ๋‹ค. master

์•ˆ๋…•ํ•˜์„ธ์š”, 1.8.5์—์„œ๋„์ด ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ํ•ด๊ฒฐ์ฑ…์„ ์ฐพ์„ ๋•Œ๊นŒ์ง€์ด ๋ฌธ์ œ๋ฅผ ๋‹ค์‹œ ์—ด ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? (๊ทธ๋ž˜์„œ ์ฐพ๊ธฐ๊ฐ€ ๋” ์‰ฝ์Šต๋‹ˆ๋‹ค!)
๊ฐ์‚ฌ!

cc @Gared

๋‚˜๋Š” ์—ฌ์ „ํžˆ์ด ๋ฌธ์ œ๊ฐ€ repo https://github.com/ether/ueberDB (๋งˆ์Šคํ„ฐ)๋กœ ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

image

์—ฌ๊ธฐ์—์„œ ๋™์ผ :

  • ํŒจ๋“œ๊ฐ€๋กœ๋“œ๋˜์ง€ ์•Š์Œ (์˜์›ํ•œ "๋กœ๋“œ ์ค‘โ€ฆ"๋˜๋Š” 502)
  • ๋‹ค์Œ ์˜ˆ์™ธ์™€ ํ•จ๊ป˜ ๋งค์‹œ๊ฐ„ ์„œ๋ฒ„๊ฐ€ ์‹คํŒจํ•ฉ๋‹ˆ๋‹ค.
[2020-09-11 11:36:24.449] [ERROR] console - error: column "value" is of type jsonb but expression is of type text
    at Parser.parseErrorMessage (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:278:15)
    at Parser.handlePacket (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/index.js:8:42)
    at Socket.emit (events.js:315:20)
    at Socket.EventEmitter.emit (domain.js:483:12)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
[2020-09-11 11:36:24.463] [ERROR] console - TypeError: Cannot read property 'name' of null
    at Client._handleParseComplete (/usr/local/var/etherpad/repo/src/node_modules/pg/lib/client.js:358:26)
    at Connection.emit (events.js:315:20)
    at Connection.EventEmitter.emit (domain.js:483:12)
    at /usr/local/var/etherpad/repo/src/node_modules/pg/lib/connection.js:109:12
    at Parser.parse (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:40:17)
    at Socket.<anonymous> (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/index.js:8:42)
    at Socket.emit (events.js:315:20)
    at Socket.EventEmitter.emit (domain.js:483:12)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
  • ์šด์˜์ฒด์ œ : Ubuntu 18.04
  • settings.json :
{
  "dbSettings" : {
                   "user"    : "etherpad",
                   "host"    : "localhost",
                   "port"    : 5432,
                   "password": "xxx",
                   "database": "etherpad",
                 },
  "padOptions": {
    "noColors":         false,
    "showControls":     true,
    "showChat":         true,
    "showLineNumbers":  true,
    "useMonospaceFont": false,
    "userName":         false,
    "userColor":        false,
    "rtl":              false,
    "alwaysShowChat":   false,
    "chatAndUsers":     false,
    "lang":             "de-de"
  },
  "suppressErrorsInPadText": false,
  "requireSession": false,
  "editOnly": true,
  "sessionNoPassword": false,
  "minify": true,
  "maxAge": 21600,
  "abiword": null,
  "soffice": null,
  "tidyHtml": null,
  "allowUnknownFileEnds": true,
  "requireAuthentication": false,
  "requireAuthorization": false,
  "trustProxy": true,
  "disableIPlogging": true,
  "automaticReconnectionTimeout": 5,
  "users": {
    "admin": {
      "hash": "xxx",
      "is_admin": true
    }
  },
  "socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"],
  "loadTest": false,
  "exposeVersion": false,
  "loglevel": "WARN",
  "logconfig" :
    { "appenders": [
        { "type": "console" }
      ]
    }
}
  • DB : postgresql 10 + 190ubuntu0.1
  • DB ์Šคํ‚ค๋งˆ :
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
CREATE FUNCTION public.ueberdb_insert_or_update(character varying, text) RETURNS void
    LANGUAGE plpgsql
    AS $_$ BEGIN   IF EXISTS( SELECT * FROM store WHERE key = $1 ) THEN     UPDATE store SET value = $2 WHERE key = $1;   ELSE     INSERT INTO store(key,value) VALUES( $1, $2 );   END IF;   RETURN; END; $_$;
ALTER FUNCTION public.ueberdb_insert_or_update(character varying, text) OWNER TO etherpad;
CREATE FUNCTION public.ueberdb_insert_or_update_jsonb(character varying, jsonb) RETURNS void
    LANGUAGE plpgsql
    AS $_$ BEGIN   IF EXISTS( SELECT * FROM store WHERE key = $1 ) THEN     UPDATE store SET value = $2 WHERE key = $1;   ELSE     INSERT INTO store(key,value) VALUES( $1, $2 );   END IF;   RETURN; END; $_$;
ALTER FUNCTION public.ueberdb_insert_or_update_jsonb(character varying, jsonb) OWNER TO etherpad;
SET default_tablespace = '';
SET default_with_oids = false;
CREATE TABLE public.store (
    key character varying(100) NOT NULL,
    value jsonb NOT NULL
);
ALTER TABLE public.store OWNER TO etherpad;
ALTER TABLE ONLY public.store
    ADD CONSTRAINT store_pkey PRIMARY KEY (key);

๋‚˜๋Š” ๋กค๋ฐฑ ๊ธธ์„ ํƒํ–ˆ๋‹ค. etherpad๋ฅผ 1.8.4๋กœ ๋กค๋ฐฑํ•˜๋ ค๊ณ ํ–ˆ์ง€๋งŒ ์ž‘๋™ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

[2020-09-11 20:55:44.494] [ERROR] console - JSON-PROBLEM:[object Object]
[2020-09-11 20:55:44.495] [ERROR] console - (node:1) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at /opt/etherpad-lite/src/node_modules/ueberdb2/CacheAndBufferLayer.js:169:24
    at Query.<anonymous> (/opt/etherpad-lite/src/node_modules/ueberdb2/postgres_common.js:99:5)
    at Query.handleReadyForQuery (/opt/etherpad-lite/src/node_modules/pg/lib/query.js:128:10)
    at Connection.<anonymous> (/opt/etherpad-lite/src/node_modules/pg/lib/client.js:247:19)
    at Connection.emit (events.js:198:13)
    at Connection.EventEmitter.emit (domain.js:448:20)
    at Socket.<anonymous> (/opt/etherpad-lite/src/node_modules/pg/lib/connection.js:134:12)
    at Socket.emit (events.js:198:13)
    at Socket.EventEmitter.emit (domain.js:448:20)
[2020-09-11 20:55:44.496] [ERROR] console - (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
[2020-09-11 20:55:44.496] [ERROR] console - (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

๊ทธ๋ž˜์„œ pgsql ๋คํ”„๋„ ๋ณต์›ํ–ˆ๊ณ  ์ด์ œ 1.8.4๊ฐ€ ๋‹ค์‹œ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค (์ž˜ ์ž‘๋™ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ๋†€๋ผ์šด ์ผ์€ ์•„๋‹™๋‹ˆ๋‹ค).

์ด์œ  : 1.8.4์—์„œ 1.8.5๋กœ ์—ด ๊ฐ’์ด ํ…์ŠคํŠธ ์œ ํ˜•์—์„œ jsonb๋กœ ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
์ฃผ์š” ๋ฆด๋ฆฌ์Šค ์—ฌ์•ผํ•ฉ๋‹ˆ๋‹ค ...

์ ์šฉ ํ•  ์ˆ˜์žˆ๋Š” ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์žˆ์Šต๋‹ˆ๊นŒ?

์ด ์ปค๋ฐ‹์„ ๋˜๋Œ๋ฆด ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋ชจ๋‘ ์ž˜๋ชป ์ฒ˜๋ฆฌ ๋œ IMHO์˜€์Šต๋‹ˆ๋‹ค.

๋ณ€๊ฒฝ ๋กœ๊ทธ์— "์ค‘์š” : 1.8.6์—์„œ postgresql์˜ ์‹ฌ๊ฐํ•œ ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค."๋ผ๊ณ  ํ‘œ์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์ œ ์„œ๋น„์Šค๋ฅผ ๋‹ค์‹œ ์‹œ์ž‘ํ•œ ์งํ›„์— ์ถœ๋ ฅ๋˜๋Š” ์ด๋Ÿฌํ•œ ์˜ˆ์™ธ๋„ ๋ฐœ๊ฒฌํ–ˆ์Šต๋‹ˆ๋‹ค.

[2020-09-19 17:47:45.482] [ERROR] console - JSON-PROBLEM:[object Object]                                    
[2020-09-19 17:47:45.496] [ERROR] console - (node:30613) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)                                                                         
    at /usr/local/var/etherpad/repo/src/node_modules/ueberdb2/lib/CacheAndBufferLayer.js:169:24
    at Query.<anonymous> (/usr/local/var/etherpad/repo/src/node_modules/ueberdb2/databases/postgres_common.js:99:5)
    at Query.handleReadyForQuery (/usr/local/var/etherpad/repo/src/node_modules/pg/lib/query.js:122:12)
    at Client._handleReadyForQuery (/usr/local/var/etherpad/repo/src/node_modules/pg/lib/client.js:281:19)
    at Connection.emit (events.js:315:20)               
    at Connection.EventEmitter.emit (domain.js:483:12)          
    at /usr/local/var/etherpad/repo/src/node_modules/pg/lib/connection.js:109:12          
    at Parser.parse (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:40:17)      
    at Socket.<anonymous> (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/index.js:8:42)
[2020-09-19 17:47:45.497] [ERROR] console - (node:30613) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)    
[2020-09-19 17:47:45.497] [ERROR] console - (node:30613) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@ c7hm4r ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๊ฐ€ ๋ณ€๊ฒฝ ๋˜์—ˆ์Šต๋‹ˆ๊นŒ? ์ƒˆ๋กœ์šด tarble / ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์‹œ์ž‘ํ•ด๋„ ๊ดœ์ฐฎ์Šต๋‹ˆ๊นŒ?

@JohnMcLear ๋นˆ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋กœ Etherpad 1.8.6์„ ๋‹ค์‹œ ์‹œ์ž‘ํ•˜๋ฉด ์ƒˆ ์Šคํ‚ค๋งˆ๊ฐ€ ์ƒ์„ฑ๋˜๊ณ  ์˜ˆ์™ธ์—†์ด ์ž‘๋™ํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์ž…๋‹ˆ๋‹ค.

์ƒˆ ์Šคํ‚ค๋งˆ๋ฅผ ์ด์ „ ์Šคํ‚ค๋งˆ์™€ ๋น„๊ตํ•  ๋•Œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

diff --git a/etherpad_schema.sql b/etherpad_schema_new.sql
index 9baf5f4..ad3c08b 100644
--- a/etherpad_schema.sql
+++ b/etherpad_schema_new.sql
@@ -41,17 +41,6 @@ CREATE FUNCTION public.ueberdb_insert_or_update(character varying, text) RETURNS

 ALTER FUNCTION public.ueberdb_insert_or_update(character varying, text) OWNER TO etherpad;

---
--- Name: ueberdb_insert_or_update_jsonb(character varying, jsonb); Type: FUNCTION; Schema: public; Owner: etherpad
---
-
-CREATE FUNCTION public.ueberdb_insert_or_update_jsonb(character varying, jsonb) RETURNS void
-    LANGUAGE plpgsql
-    AS $_$ BEGIN   IF EXISTS( SELECT * FROM store WHERE key = $1 ) THEN     UPDATE store SET value = $2 WHERE key = $1;   ELSE     INSERT INTO store(key,value) VALUES( $1, $2 );   END IF;   RETURN; END; $_$;
-
-
-ALTER FUNCTION public.ueberdb_insert_or_update_jsonb(character varying, jsonb) OWNER TO etherpad;
-
 SET default_tablespace = '';

 SET default_with_oids = false;
@@ -62,7 +51,7 @@ SET default_with_oids = false;

 CREATE TABLE public.store (
     key character varying(100) NOT NULL,
-    value jsonb NOT NULL
+    value text NOT NULL
 );

๋”ฐ๋ผ์„œ ์งˆ๋ฌธ์€ ์—ด ์œ ํ˜•์ด ๋ณ€๊ฒฝ๋œ์‹œ๊ธฐ์™€์ด๋ฅผ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ / ๋˜ ๋Œ๋ฆฌ๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.

๋งˆ์Šคํ„ฐ ๋ธŒ๋žœ์น˜์—์„œ Etherpad ์ธ์Šคํ„ด์Šค์— ๋Œ€ํ•œ ์ž๋™ ์—…๋ฐ์ดํŠธ๋ฅผ ๊ตฌ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.

@ c7hm4r @qsuscs ๋Š” ๋ฌธ์ œ๊ฐ€๋˜๋Š” ์ปค๋ฐ‹์˜ ์ž‘์„ฑ์ž์˜€์Šต๋‹ˆ๋‹ค. ๋‚˜๋Š” ๊ทธ๊ฐ€ ์—ฌ๊ธฐ์—์„œ ์•ฝ๊ฐ„์˜ ์ฑ…์ž„์„์ง€๊ณ  ๋„์›€์ด๋˜๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค. :)

https://github.com/ether/ueberDB/commit/b9e786e2c8753f4cbbe09d3695a92a1a03904ead#diff -f1b8245dd259fa912c33cb2db527f609R31์€ alter ๋ฌธ์ž…๋‹ˆ๋‹ค ..

  var updateValueColumnType = "ALTER TABLE store " +
    "ALTER COLUMN value " +
    "TYPE jsonb " +
    "USING value::jsonb";

jsonb๋ฅผ ํ…์ŠคํŠธ๋กœ ๋ณ€๊ฒฝํ•˜๋ฉด ํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๊นŒ?

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค @JohnMcLear , ๋‹ค์Œ์„ ์‹คํ–‰ํ•˜๋ฉด ๋‹ค์‹œ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.

alter table "store" alter column "value" type text;

@ c7hm4r ๊ฑฑ์ •ํ•˜์ง€ ๋งˆ์„ธ์š”.์ด ์˜ํ–ฅ์„๋ฐ›๋Š” ์†Œ์ˆ˜์˜ ์‚ฌ๋žŒ๋“ค์ด์ด ์Šค๋ ˆ๋“œ๋ฅผ ์ฐพ์•„์„œ ํ•ด๋‹น ๋ช…๋ น์„ ์ˆ˜ํ–‰ ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ž‘์„ฑํ•˜๊ณ  ํ…Œ์ŠคํŠธ ํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! :) ๋ณธ์ธ์ด๋‚˜ ์›์ €์ž๊ฐ€ ์›ํ•˜๋ฉด PR์„ ๋ฐ›์•„ ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ ์šฐ์„  ์ˆœ์œ„๋ฅผ๋‘๊ณ ์žˆ๋Š” ๋‹ค๋ฅธ ์ž‘์—…์ด ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰