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

sql: add cast support to TimeTZ #42613

Merged
merged 1 commit into from
Nov 20, 2019
Merged

Conversation

otan
Copy link
Contributor

@otan otan commented Nov 20, 2019

Refs: #26097

Added the various casts supported by postgres for timetz:

otan=# select
  castcontext,
  f.typname as "from",
  t.typname as to
from pg_cast
join pg_type as f ON (f.typelem = castsource)
join pg_type as t on (t.typelem=casttarget)
where
  castsource = 'timetz'::regtype or
  casttarget = 'timetz'::regtype;
 castcontext |     from     |   to
-------------+--------------+---------
 i           | _time        | _timetz
 a           | _timestamptz | _timetz
 i           | _timetz      | _timetz
 a           | _timetz      | _time
(4 rows)

No release not required as this will be combined with a fully fleshed
note for TimeTZ.

Release note: None

Added the various casts supported by postgres for `timetz`:

```
otan=# select
  castcontext,
  f.typname as "from",
  t.typname as to
from pg_cast
join pg_type as f ON (f.typelem = castsource)
join pg_type as t on (t.typelem=casttarget)
where
  castsource = 'timetz'::regtype or
  casttarget = 'timetz'::regtype;
 castcontext |     from     |   to
-------------+--------------+---------
 i           | _time        | _timetz
 a           | _timestamptz | _timetz
 i           | _timetz      | _timetz
 a           | _timetz      | _time
(4 rows)
```

No release not required as this will be combined with a fully fleshed
note for TimeTZ.

Release note: None
@otan otan requested review from solongordon and a team November 20, 2019 17:54
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@otan
Copy link
Contributor Author

otan commented Nov 20, 2019

bors r+

@craig
Copy link
Contributor

craig bot commented Nov 20, 2019

Build failed (retrying...)

craig bot pushed a commit that referenced this pull request Nov 20, 2019
42613: sql: add cast support to TimeTZ r=otan a=otan

Refs: #26097

Added the various casts supported by postgres for `timetz`:

```
otan=# select
  castcontext,
  f.typname as "from",
  t.typname as to
from pg_cast
join pg_type as f ON (f.typelem = castsource)
join pg_type as t on (t.typelem=casttarget)
where
  castsource = 'timetz'::regtype or
  casttarget = 'timetz'::regtype;
 castcontext |     from     |   to
-------------+--------------+---------
 i           | _time        | _timetz
 a           | _timestamptz | _timetz
 i           | _timetz      | _timetz
 a           | _timetz      | _time
(4 rows)
```

No release not required as this will be combined with a fully fleshed
note for TimeTZ.

Release note: None

42622: builtins: make date_trunc(week, timestamp[tz]) truncate to Monday r=otan a=otan

Resolves #42612

Release note (sql change): The `date_trunc` function, when used with
`week`, previously truncated to Sunday. This PR will make it follow
postgres more closely by truncating to Monday instead.

Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Nov 20, 2019

Build succeeded

@craig craig bot merged commit bebfb18 into cockroachdb:master Nov 20, 2019
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

Successfully merging this pull request may close these issues.

3 participants