Sebastien FLAESCH <sf(at)4js(dot)com> writes:
> It is normal that a TRUNCATE TABLE statement changes the table/sequence relation in pg_attrdef?
It is normal for TRUNCATE, as well as several other kinds of DDL, to
change relfilenode.
> test1=> select a.adsrc from pg_class p join pg_attrdef a on (p.relfilenode = a.adrelid) where lower(p.relname) = lower('mytab');
This query is simply wrong; the join column should be p.oid. See the
system catalog definitions,
https://www.postgresql.org/docs/current/static/catalogs.html
regards, tom lane