Skip to content
Permalink
Browse files

To retrieve a column default value, prefer pg_attrdef.adbin column ov…

…er pg_attrdef.adsrc. PostgreSQL 12 does not have adsrc. Closes #763
  • Loading branch information...
ansgarbecker committed Oct 5, 2019
1 parent 64c43ae commit d191f1cfa0d05ed8a56009d848d7cc486eb8537b
Showing with 1 addition and 1 deletion.
  1. +1 −1 source/dbconnection.pas
@@ -2854,7 +2854,7 @@ function TDBConnection.GetCreateCode(Obj: TDBObject): String;
' FORMAT_TYPE(a.atttypid, a.atttypmod) AS data_type, '+
' CASE a.attnotnull WHEN false THEN '+EscapeString('YES')+' ELSE '+EscapeString('NO')+' END AS IS_NULLABLE, '+
' com.description AS column_comment, '+
' def.adsrc AS column_default, '+
' pg_get_expr(def.adbin, def.adrelid) AS column_default, '+
' NULL AS character_maximum_length '+
'FROM pg_attribute AS a '+
'JOIN pg_class AS pgc ON pgc.oid = a.attrelid '+

0 comments on commit d191f1c

Please sign in to comment.
You can’t perform that action at this time.