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

Function Error [PDF:301] #62

Open
amarakov opened this issue May 1, 2021 · 0 comments
Open

Function Error [PDF:301] #62

amarakov opened this issue May 1, 2021 · 0 comments

Comments

@amarakov
Copy link

amarakov commented May 1, 2021

My attempt to run the query on pg 301, after making a materialized view and a function, returns the following error:

ERROR:  could not read block 26 in file "base/16387/18490": Bad address
CONTEXT:  SQL function "low_time" statement 1

I've made sure that the first block of the query functions as expected

with lows_by_week as (
  select year, week,
  min(altitude) as altitude
  from flyby_altitudes
  group by year, week
)

The internet seems to think this has to do with something about function mutability, but since I'm pretty new to SQL that statement does not mean much to me. More importantly, I am not sure what I would change about the low_time() function declaration to avoid this error.

Any ideas?


For reference, the full block of code on this page is:

with lows_by_week as (
  select year, week,
  min(altitude) as altitude
  from flyby_altitudes
  group by year, week
), nadirs as (
  select low_time(altitude,year,week) as time_stamp,
  altitude
  from lows_by_week
)
select * from nadirs;
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