Postgres error after upgrade to 1.7.6 #1519
-
Describe the problem/questionAfter upgrade to privatebin 1.7.6 i cannot save an paste anymore. The database log shows this: postgres-1 | 2025-03-06 21:58:16.809 CET [34] ERROR: invalid input syntax for type integer: "{"salt":"XXX"}" Did you use the FAQ section?
What you did?
... What happensError message see above when saving a paste What should happenThe paste should be saved Additional informationPostgres 15 Server addressServer OSprivatebin/pdo:1.7.6 Webserverprivatebin/pdo:1.7.6 PrivateBin versionprivatebin/pdo:1.7.6 Browser and versionChrome Local operating system and versionmacOS 15.3.1 Issue reproducibilityNo, I cannot reproduce it on https://privatebin.net. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
In release 1.7.2 we dropped the unused postdate column from the paste table schema. If the permissions of the postgres user allow for this, the schema should get automatically upgraded for you, otherwise you will have to manually adjust the schema: PrivateBin/lib/Data/Database.php Lines 908 to 924 in dd6537b I don't remember the column order before the change, but would guess that postdate column was of an integer type and in the 6th position, hence the new versions failure to write a JSON string with the meta data into the still existing integer column. Edit: corrected the version number that introduced the change from 1.7.1 to 1.7.2 |
Beta Was this translation helpful? Give feedback.
-
I run this SQL in Postgres 15 -- Grant CREATE, INDEX, and ALTER privileges on the schema
GRANT CREATE ON SCHEMA public TO privatebin;
-- Grant INSERT and UPDATE privileges on the config table
GRANT INSERT, UPDATE ON TABLE config TO privatebin; We now expect the next upgrade to be performed automatically with schema changes. Thanks again! Incidentally, would this type of per-version change be important enough to be included in the changelog? |
Beta Was this translation helpful? Give feedback.
Thank you! The ALTER TABLE statement fixed the issue for us. Now i will have a look why the schema was not automatically changed.