app icon indicating copy to clipboard operation
app copied to clipboard

Cannot connect to Postgres DB after prisma push

Open nguyennamduong opened this issue 1 year ago • 3 comments

The connection was fine with the fresh new database. After pushing schema from prisma, the postgres db cannot be connected anymore. This is the log:

22071 database WebDB App running 5432 select * from pg_database where datistemplate = false 5432 postgres select table_schema, table_name, table_type from information_schema.tables 5432 postgres select * from information_schema.schemata 5432 devdb select table_schema, table_name, table_type from information_schema.tables 5432 devdb select * from information_schema.schemata 5432 select * from pg_database where datistemplate = false 5432 postgres select * from information_schema.schemata 5432 devdb select * from information_schema.schemata 5432 postgres select table_schema, table_name, table_type from information_schema.tables 5432 devdb select table_schema, table_name, column_name, character_maximum_length, ordinal_position, column_default, is_nullable, udt_name::regtype as data_type from information_schema.columns order by ordinal_position 5432 postgres select table_schema, table_name, column_name, character_maximum_length, ordinal_position, column_default, is_nullable, udt_name::regtype as data_type from information_schema.columns order by ordinal_position 5432 devdb select table_schema, table_name, table_type from information_schema.tables 5432 select * from pg_database where datistemplate = false 5432 postgres select routine_name as name, routine_type as type, routine_schema as schema, routine_definition as value from information_schema.routines where routine_schema not in ('pg_catalog', 'information_schema') and routine_type is not null order by routine_name 5432 devdb select routine_name as name, routine_type as type, routine_schema as schema, routine_definition as value from information_schema.routines where routine_schema not in ('pg_catalog', 'information_schema') and routine_type is not null order by routine_name 5432 postgres select constraint_name as name, ccu.table_schema as schema, table_name as table, column_name as column, pg_get_constraintdef(pgc.oid) as value from pg_constraint pgc join pg_namespace nsp on nsp.oid = pgc.connamespace join pg_class cls on pgc.conrelid = cls.oid left join information_schema.constraint_column_usage ccu on pgc.conname = ccu.constraint_name and nsp.nspname = ccu.constraint_schema where contype = 'c' order by pgc.conname 5432 devdb select constraint_name as name, ccu.table_schema as schema, table_name as table, column_name as column, pg_get_constraintdef(pgc.oid) as value from pg_constraint pgc join pg_namespace nsp on nsp.oid = pgc.connamespace join pg_class cls on pgc.conrelid = cls.oid left join information_schema.constraint_column_usage ccu on pgc.conname = ccu.constraint_name and nsp.nspname = ccu.constraint_schema where contype = 'c' order by pgc.conname 5432 postgres select user_defined_type_schema as schema, user_defined_type_name as name from information_schema.user_defined_types 5432 postgres select t.typname as name, string_agg(e.enumlabel, ', ') as value, nspname as schema from pg_type t join pg_enum e on t.oid = e.enumtypid join pg_catalog.pg_namespace n on n.oid = t.typnamespace group by schema, name 5432 postgres select schemaname as schema, matviewname as name, definition as value from pg_matviews 5432 postgres select sequence_schema as schema, sequence_name as name, ' as ' || data_type || ' minvalue ' || minimum_value || ' maxvalue ' || maximum_value || ' start with ' || start_value || ' increment by ' || increment as value from information_schema.sequences 5432 postgres select trigger_name as name, trigger_schema as schema, event_object_table as table, action_statement as value from information_schema.triggers 5432 postgres select n.nspname as schema, t.typname as name, pg_catalog.format_type (t.typbasetype, t.typtypmod) as underlying_type, t.typnotnull as not_null, ( select c.collname from pg_catalog.pg_collation c, pg_catalog.pg_type bt where c.oid = t.typcollation and bt.oid = t.typbasetype and t.typcollation <> bt.typcollation ) as collation, t.typdefault as default, pg_catalog.array_to_string ( array( select pg_catalog.pg_get_constraintdef (r.oid, true) from pg_catalog.pg_constraint r where t.oid = r.contypid ), ' ' ) as check_constraints from pg_catalog.pg_type t left join pg_catalog.pg_namespace n on n.oid = t.typnamespace where t.typtype = 'd' and n.nspname <> 'pg_catalog' and n.nspname <> 'information_chema' and pg_catalog.pg_type_is_visible (t.oid) 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(). The promise rejected with the reason: TypeError: columns is not iterable at file:///usr/src/app/src/wrapper/postgre.js:511:28 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) TypeError: columns is not iterable at file:///usr/src/app/src/wrapper/postgre.js:511:28 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Exiting WebDB

nguyennamduong avatar May 17 '24 12:05 nguyennamduong

Hello,

Can you give me the database schema please

WebDB-App avatar May 18 '24 08:05 WebDB-App

This is my current schema

...

nguyennamduong avatar May 18 '24 12:05 nguyennamduong

Thanks for reporting the issue. It should works now

Tell me

aleluff avatar May 20 '24 14:05 aleluff

Sorry, there was a problem with the CI.

It should be fixed now. Can you try please

aleluff avatar Jun 06 '24 20:06 aleluff

Thanks for the fix. Is the new version supporting ARM? I am running docker on ARM.

nguyennamduong avatar Jun 06 '24 20:06 nguyennamduong

Normally, everything should works fine, as I don't have an ARM computer I can't ensure so let me know =)

aleluff avatar Jun 06 '24 20:06 aleluff

Tested on AMD64 and it works. Do you have plan to release ARM Docker build? I used that before. The documentation states that the app supports both AMD and ARM. Or an instruction how to build an docker image is also helpful. Thanks again.

nguyennamduong avatar Jun 06 '24 21:06 nguyennamduong

Hey,

ARM images are back =)

aleluff avatar Jun 08 '24 10:06 aleluff