Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

columnFromVar sometimes called with a variable with negative varattno #186

Open
kaidaguerre opened this issue May 20, 2022 · 0 comments
Open

Comments

@kaidaguerre
Copy link
Contributor

Investigate why this is and fix

This has been seen when running the queries

insert into
  seen_hn_top (id, title, text, url, time)

  -- Alert for top items on a range of subjects
  select
    id,
    title,
    text,
    url,
    time
  from
    hackernews_top
  where
    (
      title ilike '%sql%'
      or title ilike '%osquery%'
      or title ilike '%postgres%'
      or title ilike '%steampipe%'
    )
    and id not in
    (
      select
        id
      from
        seen_hn_top
    )

  union

  -- Alert immediately for anything Steampipe related
  select
    id,
    title,
    text,
    url,
    time
  from
    hackernews_new
  where
    (
      title ilike '%steampipe%'
      or url ilike '%steampipe%'
    )
    and id not in
    (
      select
        id
      from
        seen_hn_top
    )

  returning *;
select
  '#ff6600' as color,
  title || ' - ' || url as fallback,
  title,
  text,
  url as title_link,
  'Hacker News' as footer
from
  seen_hn_top
where
  seen > current_timestamp - interval '2 mins'
insert into
  seen_twitter_mention (id, text, url, username, created_at)
  select
    id,
    text,
    'https://twitter.com/' || (author->>'username') || '/statuses/' || id as url,
    author->>'username' as username,
    created_at
  from
    twitter_search_recent
  where
    query = '(steampipe OR steampipe.io OR github.com/turbot) -tomathy -GutturalSteve -"steampipe alley"'
    and id not in
    (
      select
        id
      from
        seen_twitter_mention
    )
    returning *;
select
  '#1da1f2' as color,
  url as fallback,
  text,
  id || ' by @' || username as title,
  url as title_link,
  'Twitter' as footer
from
  seen_twitter_mention
where
  seen > current_timestamp - interval '2 mins'
@kaidaguerre kaidaguerre changed the title columnFromVar sometimes called with a vatoiable with negative varattno columnFromVar sometimes called with a variable with negative varattno May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant