Skip to content

sql: cannot store "AS OF SYSTEM TIME" clause in views #50753

@robert-s-lee

Description

@robert-s-lee

Describe the problem

would like to use AOST on reporting side without having to change the application.

To Reproduce

select ycsb_key from usertable as of system time '-1m' limit 1;

create view x as select ycsb_key from usertable as of system time '-1m' limit 1;
ERROR: AS OF SYSTEM TIME must be provided on a top-level statement
SQLSTATE: 42601

Expected behavior

support AOST inside view

Additional data / screenshots

If applicable, add screenshots to help explain your problem.

Environment:

  • CockroachDB version 20.1.1
  • Server OS: osx
  • Client app cockroach sql

Additional context

changes are required on every SQL that require the use of AOST

related: #96391

Epic CRDB-9838
gz#5693

Jira issue: CRDB-4093

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-executorSQL txn logicC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamX-nostaleMarks an issue/pr that should be ignored by the stale bot

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions