Can I select a field/column from data type?
Postgres 7.4 (yep we are upgrading)
SELECT *
FROM tbl_name
WHERE tbl_name.column = 'timestamp with time zone'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That requires metadata.
ETA: If you want the actual data from the table with column names matching the list above, you could probably set up a user-defined function that would grab those column names, put them in a comma-delimited list, and parse the query from tbl_name appropriately (of course, this is a lot easier if you’re working in a scripting language slightly outside of the database).