<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yohei-a</author_name>
  <author_url>https://blog.hatena.ne.jp/yohei-a/</author_url>
  <blog_title>ablog</blog_title>
  <blog_url>https://yohei-a.hatenablog.jp/</blog_url>
  <categories>
    <anon>psql</anon>
  </categories>
  <description>psql から Amazon Redshift でクエリ実行後に pg_last_query_id() で直前のクエリIDを取得して、stl_query や svl_query_summary からクエリIDでフィルタして性能情報を取得したかったんだけど、psql だとクエリ実行後に \gset を実行するとカラム名が変数名になって結果をセットすることができた。 yoheia/exec_query_perf.sql at master · yoheia/yoheia · GitHub -- query id select pg_last_query_id(); \gset -- executi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohei-a.hatenablog.jp%2Fentry%2F20211112%2F1636672404&quot; title=&quot;psql で select 結果を変数にセットして、その後の select のフィルタ条件に変数を埋め込む - ablog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-11-12 08:13:24</published>
  <title>psql で select 結果を変数にセットして、その後の select のフィルタ条件に変数を埋め込む</title>
  <type>rich</type>
  <url>https://yohei-a.hatenablog.jp/entry/20211112/1636672404</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
