summaryrefslogtreecommitdiff
path: root/python/skytools/dbstruct.py
diff options
context:
space:
mode:
authorMarko Kreen2010-11-02 13:25:06 +0000
committerMarko Kreen2010-11-02 13:41:48 +0000
commit9ece8f300cbdfd54431ef16fe822e25c787d5813 (patch)
tree32a078988928dfebde5903946093e572e4f78df8 /python/skytools/dbstruct.py
parentd56027f9d6dc8b0080bbf994c33edf7c2f92e609 (diff)
dbstruct: use adbin instead of adsrc when detecting default
Diffstat (limited to 'python/skytools/dbstruct.py')
-rw-r--r--python/skytools/dbstruct.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/skytools/dbstruct.py b/python/skytools/dbstruct.py
index f75a0552..13c0fbd1 100644
--- a/python/skytools/dbstruct.py
+++ b/python/skytools/dbstruct.py
@@ -328,7 +328,7 @@ class TColumn(TElem):
a.attname || ' '
|| format_type(a.atttypid, a.atttypmod)
|| case when a.attnotnull then ' not null' else '' end
- || case when a.atthasdef then ' default ' || d.adsrc else '' end
+ || case when a.atthasdef then ' default ' || pg_get_expr(d.adbin, d.adrelid) else '' end
as def,
pg_get_serial_sequence(%(fq2name)s, a.attname) as seqname
from pg_attribute a left join pg_attrdef d