Add a timezone(timestamp(p) with time zone) -> varchar
extraction function to get IANA timezone ID
#20893
Labels
timezone(timestamp(p) with time zone) -> varchar
extraction function to get IANA timezone ID
#20893
Request
Similar to the
current_timezone()
function which returns the timezone of the current session, it would be nice to generalize this to allow extraction of timezone info from any providedtimestamp(p) with time zone
. Currently there are already functions to get timezone offsets (extract(TIMEZONE_HOUR from x)
andextract(TIMEZONE_MINUTE from x)
), but this loses information about the actual timezone. A lossless extraction function that would return the IANA timezone ID would be ideal.Workaround
You can cast the
timestamp(p) with time zone
to a string, and manually extract the suffix.The text was updated successfully, but these errors were encountered: