jklingsporn / vertx-jooq

A jOOQ-CodeGenerator to create vertx-ified DAOs and POJOs.
MIT License
384 stars 53 forks source link

Postgresql package 'xxxx' does not exist #96

Closed haposan06 closed 5 years ago

haposan06 commented 5 years ago

I generate daos from jooq code-gen, tested it in staging environment and everything working well as expected. I migrated into production db, and suddenly I encountered this error.

Begin stacktrace io.reactiverse.pgclient.PgException: package "promo_master" does not exist at io.reactiverse.pgclient.impl.PrepareStatementCommand.handleErrorResponse(PrepareStatementCommand.java:73) at io.reactiverse.pgclient.impl.codec.decoder.MessageDecoder.decodeError(MessageDecoder.java:253) at io.reactiverse.pgclient.impl.codec.decoder.MessageDecoder.decodeMessage(MessageDecoder.java:142) at io.reactiverse.pgclient.impl.codec.decoder.MessageDecoder.channelRead(MessageDecoder.java:122) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) End stacktrace

I think ( I hope so) the migration went well from database perspective. I ran number of daos and working well, but only in xxxDao.findAll() produced above error only in production. (findAll method is auto generated from jooq code-gen).

I have tried to rename the table name promo_master to promo_master1, and it produced expected error which is relation table promo_master1 does not exist. So it isnt table name error. Any thought of what happens here?

Thank you

jklingsporn commented 5 years ago

Since your code seems to work on local and staging environment, there must be a different schema setup in production (have you checked the locale?). However without knowing the schema and the query that actually was executed it is hard to tell.

haposan06 commented 5 years ago

Since your code seems to work on local and staging environment, there must be a different schema setup in production (have you checked the locale?). However without knowing the schema and the query that actually was executed it is hard to tell.

Yeah. Plus the table was badly designed with more than 40 columns and overuse of index. I have found the cause, its because there is one index not created during migration script.