Error with loading tables and view in pages section

darren

Member
Hello I am receiving an error when trying to view the current list of tables/views in the admin area.

This is the error i receive

[pre]
[08] Error: during query execution. SELECT pg_attribute.attname, format_type(pg_attribute.atttypid, pg_attribute.atttypmod) as data_type, attnotnull, CASE WHEN pg_attribute.atttypid = ANY ('{int,int8,int2}'::regtype[]) AND EXISTS ( SELECT 1 FROM pg_attrdef WHERE pg_attrdef.adrelid = pg_attribute.attrelid AND pg_attrdef.adnum = pg_attribute.attnum AND pg_attrdef.adsrc = 'nextval(''' || (pg_get_serial_sequence (pg_attribute.attrelid::regclass::text , pg_attribute.attname))::regclass || '''::regclass)') THEN CASE pg_attribute.atttypid WHEN 'int'::regtype THEN 'serial' WHEN 'int8'::regtype THEN 'bigserial' WHEN 'int2'::regtype THEN 'smallserial' END END AS extra FROM pg_attribute WHERE pg_attribute.attrelid = 'adoption_num_emp'::regclass AND pg_attribute.attnum > 0 AND NOT pg_attribute.attisdropped ORDER BY pg_attribute.attnum
The DBMS server said: SQLSTATE[42703]: Undefined column: 7 ERROR: column pg_attrdef.adsrc does not exist LINE 2: AND pg_attrdef.adsrc = 'nextval(''' || (pg_g... ^
[/pre]

I am unable to add or rename or change any tables/views because of this error.

Any suggestions?

dadabik 10.0

PHP Version: 7.3.15-1+ubuntu18.04.1+deb.sury.org+1

postgres version: 12.2 (Ubuntu 12.2-1.pgdg18.04+1)

Web server: Apache/2.4.29 (Ubuntu)

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36
 

eugenio

Administrator
Staff member
Hello,
you are getting such error because in postgres 12 they removed the attribute adsrc.

I'll try to post here a fix within a couple of days!


Best,
 

darren

Member
Okay I figured as much, by your code it seemed like the adsrc displayed things like 'int8' 'bigint' etc. I was trying to find the equivalent in Postgres but I was unable to. If I find anything I would be happy to post it back to you
 

eugenio

Administrator
Staff member
Hello,
could you try to replace, in include/db_functions_pdo.php

this string

pg_attrdef.adsrc

with

pg_get_expr(adbin, adrelid)

?
 
Top