# note that driver-name could be driver's module name if you went module approach.
/subsystem=datasources/data-source=postgresDS:add(jndi-name=java:/postgresDS,  driver-name=postgresql-8.3-603.jdbc3.jar, driver-class=org.postgresql.Driver, connection-url=jdbc:postgresql://{host}:5432/{database}, user-name={user}, password={password})

# XA Data source
#batch
#/subsystem=datasources/xa-data-source=postgresDS:add(jndi-name=java:/postgresDS,  driver-name=postgresql-8.3-603.jdbc3.jar, xa-datasource-class=org.postgresql.xa.PGXADataSource, user-name={user}, password={password})
#/subsystem=datasources/xa-data-source=postgresDS/xa-datasource-properties=DatabaseName:add(value={database_name})
#/subsystem=datasources/xa-data-source=postgresDS/xa-datasource-properties=PortNumber:add(value=5432)
#/subsystem=datasources/xa-data-source=postgresDS/xa-datasource-properties=ServerName:add(value={host})
#/subsystem=datasources/xa-data-source=postgresDS:enable
#run-batch


## If you are working in a clustered environment, prepend "/profile=ha" to all the above commands that start with "/subsystem=.." 