Skip to content

sql: support casting arrays and tuples to strings#28183

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20180802-advanced-casts
Aug 3, 2018
Merged

sql: support casting arrays and tuples to strings#28183
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20180802-advanced-casts

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Aug 2, 2018

Fixes #24746.
Forked off #28143.

The previous patch to fix pgwire text encoding for tuples/arrays
really defines a different conversion algorithm from array/tuples to
strings.

This incidentally is the general-purpose algorithm used in PostgreSQL
to convert arrays and tuples to strings, not just for pgwire.

This patch utilizes this observation to define the new
(and now correct) casts from array and tuple types to strings
based on the new algorithm, like PostgreSQL does.

Release note (sql change): CockroachDB now supports converting arrays
and tuples to strings for compatibility with PostgreSQL.

@knz knz requested review from a team, BramGruneir and justinj August 2, 2018 00:00
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

The previous patch to fix pgwire text encoding for tuples/arrays
really defines a different conversion algorithm from array/tuples to
strings.

This incidentally is the general-purpose algorithm used in PostgreSQL
to convert arrays and tuples to strings, not just for pgwire.

This patch utilizes this observation to define the new
(and now correct) casts from array and tuple types to strings
based on the new algorithm, like PostgreSQL does.

Release note (sql change): CockroachDB now supports converting arrays
and tuples to strings for compatibility with PostgreSQL.
@knz knz force-pushed the 20180802-advanced-casts branch from f068bbe to ada0e4d Compare August 3, 2018 07:09
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Aug 3, 2018

rebased, RFAL

Copy link
Copy Markdown
Member

@BramGruneir BramGruneir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Aug 3, 2018

thanks!

bors r+

craig bot pushed a commit that referenced this pull request Aug 3, 2018
28183: sql: support casting arrays and tuples to strings r=knz a=knz

Fixes #24746.
Forked off #28143.

The previous patch to fix pgwire text encoding for tuples/arrays
really defines a different conversion algorithm from array/tuples to
strings.

This incidentally is the general-purpose algorithm used in PostgreSQL
to convert arrays and tuples to strings, not just for pgwire.

This patch utilizes this observation to define the new
(and now correct) casts from array and tuple types to strings
based on the new algorithm, like PostgreSQL does.

Release note (sql change): CockroachDB now supports converting arrays
and tuples to strings for compatibility with PostgreSQL.

Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 3, 2018

Build succeeded

@craig craig bot merged commit ada0e4d into cockroachdb:master Aug 3, 2018
@knz knz deleted the 20180802-advanced-casts branch August 3, 2018 23:27
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.

sql: support casting arrays to string

3 participants