@@ -135,6 +135,13 @@ function mixinDiscovery(PostgreSQL) {
135135 cb ( err , results ) ;
136136 } else {
137137 results . map ( function ( r ) {
138+ // PostgreSQL returns ALWAYS in case the property is generated,
139+ // otherwise it returns NEVER
140+ if ( r . generated === 'ALWAYS' ) {
141+ r . generated = true ;
142+ } else {
143+ r . generated = false ;
144+ }
138145 // PostgreSQL accepts float(1) to float(24) as selecting the `real` type,
139146 // while float(25) to float(53) select `double precision`
140147 // https://www.postgresql.org/docs/9.4/static/datatype-numeric.html
@@ -166,6 +173,7 @@ function mixinDiscovery(PostgreSQL) {
166173 if ( owner ) {
167174 sql = this . paginateSQL ( 'SELECT table_schema AS "owner", table_name AS "tableName", column_name AS "columnName",'
168175 + 'data_type AS "dataType", character_maximum_length AS "dataLength", numeric_precision AS "dataPrecision",'
176+ + ' is_generated AS "generated",'
169177 + ' numeric_scale AS "dataScale", is_nullable AS "nullable"'
170178 + ' FROM information_schema.columns'
171179 + ' WHERE table_schema=\'' + owner + '\''
@@ -175,6 +183,7 @@ function mixinDiscovery(PostgreSQL) {
175183 sql = this . paginateSQL ( 'SELECT current_schema() AS "owner", table_name AS "tableName",'
176184 + ' column_name AS "columnName",'
177185 + ' data_type AS "dataType", character_maximum_length AS "dataLength", numeric_precision AS "dataPrecision",'
186+ + ' is_generated AS "generated",'
178187 + ' numeric_scale AS "dataScale", is_nullable AS "nullable"'
179188 + ' FROM information_schema.columns'
180189 + ( table ? ' WHERE table_name=\'' + table + '\'' : '' ) ,
0 commit comments