> require "luasql.postgres" Try with : luasql = require "luasql.postgres" In Lua 5.2, modules are not exported by default to the global environment anymore. (But this depends in fact on how the module is actually implemented).