Skip to content

sql: Add server_version_num session variable#19405

Merged
knz merged 1 commit intocockroachdb:masterfrom
jimlar:add_server_version_num_session_variable
Oct 20, 2017
Merged

sql: Add server_version_num session variable#19405
knz merged 1 commit intocockroachdb:masterfrom
jimlar:add_server_version_num_session_variable

Conversation

@jimlar
Copy link
Copy Markdown
Contributor

@jimlar jimlar commented Oct 20, 2017

I've come across an ORM that is using this session vaiable to detect
postgres version. Seems ok to support this since server_version
is already present. This can make life easier when porting an app from
postgres to cockroachdb.

Not sure about the type of the var being string type, but I can see
other vars that are integers in postgres that are represented as strings
here (max_index_keys for example).

The specific ORM I've come across is "dat" for Go: https://github.com/mgutz/dat

My guess is that other ORMs/frameworks would use this variable too to check
postgres version > some version.

@jimlar jimlar requested review from a team October 20, 2017 12:54
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@knz
Copy link
Copy Markdown
Contributor

knz commented Oct 20, 2017

Hello! Thank you for your contribution!
The code change looks good.

Can you tell us more which ORM motivates this change? It would be best if you could spell it out in the commit message, so that a person who reads the history of the code can get the context for the change.

Thank you again!


Reviewed 6 of 6 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from Reviewable

I've come across an ORM that is using this session vaiable to detect
postgres version. Seems ok to support this since server_version
is already present. This can make life easier when porting an app from
postgres to cockroachdb.

Not sure about the type of the var being string type, but I can see
other vars that are integers in postgres that are represented as strings
here (max_index_keys for example).

The specific ORM I've come across is "dat" for Go: https://github.com/mgutz/dat

My guess is that other ORMs/frameworks would use this variable too to check
postgres version > some version.
@jimlar jimlar force-pushed the add_server_version_num_session_variable branch from 14812d4 to e982537 Compare October 20, 2017 13:13
@jimlar
Copy link
Copy Markdown
Contributor Author

jimlar commented Oct 20, 2017

@knz good call, I've update the PR and commit message

@knz
Copy link
Copy Markdown
Contributor

knz commented Oct 20, 2017

Thank you!

:lgtm:


Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from Reviewable

@knz knz merged commit 67c5436 into cockroachdb:master Oct 20, 2017
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