=?UTF-8?B?Ik5pbHMgTy4gU2Vsw6VzZGFsIg==?= <noselasd@asgaard.homelinux.org> writes:
> I'm wondering if there's a way to show the column type of a result with
> psql, e.g.
>>> select sum(r) from mytable;
> r
> -------
> 101.0
> I'd like to see the type of the 'r' column.
There's nothing built-in to psql, but you could modify the query, eg
select pg_typeof(sum(r)) from mytable;
(Adding "LIMIT 1" would be wise in most cases, though you don't need it
here.)
regards, tom lane