Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL: WITH OIDs no longer supported #774

Open
titanofold opened this issue Dec 3, 2021 · 4 comments
Open

PostgreSQL: WITH OIDs no longer supported #774

titanofold opened this issue Dec 3, 2021 · 4 comments

Comments

@titanofold
Copy link
Contributor

My site is no longer loading with a recent upgrade for PostgreSQL.

WITH OIDs has actually been deprecated since 2005. There was a mailing list
announcement from 2018 that has some details:
https://www.postgresql.org/message-id/E1gPG3j-0003cy-03%40gemulon.postgresql.org

== ERROR-REPORT (DEBUGGING ENABLED) ==
== (When you copy this debug output to a forum or other places, make sure to remove your username/passwords, as they may be contained within function calls) ==

#0  errorToExceptionHandler(2, pg_query(): Query failed: ERROR:  tables declared WITH OIDS are not supported, /srv/www/serendipity/include/db/postgres.inc.php, 224)
#1  pg_query(Resource id #21, SET default_with_oids = true) called at [/srv/www/serendipity/include/db/postgres.inc.php:224]
#2  serendipity_db_query(SET default_with_oids = true, 1, both, , , , 1) called at [/srv/www/serendipity/include/db/postgres.inc.php:218]
#3  serendipity_db_query(SELECT name, value
                                        FROM serendipity_config
                                        WHERE authorid = 0) called at [/srv/www/serendipity/include/functions_config.inc.php:314]
#4  serendipity_load_configuration() called at [/srv/www/serendipity/serendipity_config.inc.php:339]
#5  include(/srv/www/serendipity/serendipity_config.inc.php) called at [/srv/www/serendipity/serendipity_admin.php:9]

Warning: pg_query(): Query failed: ERROR: tables declared WITH OIDS are not supported in /srv/www/serendipity/include/db/postgres.inc.php on line 224.

 == ERROR-REPORT (DEBUGGING ENABLED) == 

 == (When you copy this debug output to a forum or other places, make sure to remove your username/passwords, as they may be contained within function calls) == 

#0  errorToExceptionHandler(1, Uncaught ErrorException: Warning: pg_query(): Query failed: ERROR:  tables declared WITH OIDS are not supported in /srv/www/serendipity/include/db/postgres.inc.php:224
Stack trace:
#0 [internal function]: errorToExceptionHandler()
#1 /srv/www/serendipity/include/db/postgres.inc.php(224): pg_query()
#2 /srv/www/serendipity/include/db/postgres.inc.php(218): serendipity_db_query()
#3 /srv/www/serendipity/include/functions_config.inc.php(314): serendipity_db_query()
#4 /srv/www/serendipity/serendipity_config.inc.php(339): serendipity_load_configuration()
#5 /srv/www/serendipity/serendipity_admin.php(9): include('...')
#6 {main}
  thrown, /srv/www/serendipity/include/db/postgres.inc.php, 224) called at [/srv/www/serendipity/include/compat.inc.php:254]
#1  fatalErrorShutdownHandler()

Fatal Error: Uncaught ErrorException: Warning: pg_query(): Query failed: ERROR:  tables declared WITH OIDS are not supported in /srv/www/serendipity/include/db/postgres.inc.php:224
Stack trace:
#0 [internal function]: errorToExceptionHandler()
#1 /srv/www/serendipity/include/db/postgres.inc.php(224): pg_query()
#2 /srv/www/serendipity/include/db/postgres.inc.php(218): serendipity_db_query()
#3 /srv/www/serendipity/include/functions_config.inc.php(314): serendipity_db_query()
#4 /srv/www/serendipity/serendipity_config.inc.php(339): serendipity_load_configuration()
#5 /srv/www/serendipity/serendipity_admin.php(9): include('...')
#6 {main}
  thrown in /srv/www/serendipity/include/db/postgres.inc.php on line 224.
@onli
Copy link
Member

onli commented Dec 30, 2021

@titanofold I can have a look at whether my test environment supports PostgreSQL, but am not sure how to fix this. Do you have a recommendation, ideally: Could you submit a Pull Request for this?

@Zugschlus
Copy link

Zugschlus commented Aug 25, 2023

Is there a workaround around this? I have been bitten when upgrading Serendipity almost two years after this issue stalled. How would I get my blog back up?

If it is only the test environment that is missing, I can provide a VM with Debian stable/testing/unstable (your choice), a PostgreSQL database, apache, PHP (what ever is part of the Debian you chose) and root.

@onli
Copy link
Member

onli commented Aug 28, 2023

@Zugschlus Could you try a fix for me?

In include/db/postgres.inc.php, there is this code in line 218:

@serendipity_db_query('SET default_with_oids = true', true, 'both', false, false, false, true);

Does the blog work if you remove that line?

If I read the stacktrace correctly this is where the error is coming from, it's also the only place in the core where default_with_oids is set. Removing it could make everything work directly.

@Zugschlus
Copy link

I'm going to try that in the next few days. Since i have rolled back the machine to the last working state in the mean time, I need to build a reference box. Thanks for helping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants