How do I get datatype of specific field from table in postgres ? For example I have the following table, student_details ( stu_id integer, stu_name varcha
You can use the pg_typeof() function, which also works well for arbitrary values.
SELECT pg_typeof("stu_id"), pg_typeof(100) from student_details limit 1;