Closed foopis23 closed 2 years ago
Hi, @foopis23. What was the database version you used when you encountered the error?
9.5.25
@foopis23 I cannot guarantee that pg-typegen will work as expected with v9 and older versions of postgres. Postgres v9 is obsolete and no longer supported. I'd suggest upgrading to a newer postgres version. If you encounter the same error on v10 or newer version of postgres, reach out and I'll try to assist.
So I used this package on a previous project and it worked perfectly fine with no issue. Then, when I started a new project, I created a new database on the same version and even same DBMS as the first database, but when I tried to generated types I got this error here.
I'm not a database expert, I can do basic queries, joins, and all of the intro to database stuff, but after fiddling with the query to getTableDefinitions for awhile I realized that if you just remove the parts of the select that use
::regclass
the query doesn't throw the error, and from what I can tell my types still generated normally?I still wonder if this is just a config issue on the database side of things, but I'm pretty sure everything is the exact same as the first project when it worked.
I would provide extra info about my database, but I don't exactly know what its helpful and what is not, so will provide if asked. I would really appreciate help resolving this.
Finally, if anyone run into this, and is wondering exactly what I did to get it to run. I changed
node_modules/pg-typegen/src/postgres.js
so that the getTableDefiniations functions looks like this