Are you doing any Class.forName(...) calls on the JDBC driver from within your application? If not, I don't see why it would try to load that class in the context of your deployment classloader.
If you are indeed referring to the JDBC driver class within your application, then add a module dependency of the JDBC module (org.postgresql in this example), to your application (myejb.jar). You can do that by following the instructions here Class Loading in WildFly - Latest WildFly Documentation - Project Documentation Editor (see section "Dependencies: Manifest Entries")
Thank you for your answer. I had the solution from an answer received from Stack Overflow (https://stackoverflow.com/questions/56930075/why-wildfly-does-not-find-the-postgresql-driver), which was to use jboss-deployment-structure file which I put in folder ejbModule\Meta-Inf. its content is:
<?xml version="1.0" encoding="UTF-8"?>
To summarise, I had to create a module.xml, file a jboss-deployment-structure.xml file and to modify the standalone.xml file.