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

compose: have cockroach use the "postgres" database #47768

Merged
merged 1 commit into from
Apr 22, 2020
Merged

compose: have cockroach use the "postgres" database #47768

merged 1 commit into from
Apr 22, 2020

Conversation

maddyblue
Copy link
Contributor

This is needed because postgres can't do cross-database queries. So,
we'll just use the default "postgres" database since it exists at startup,
and have cockroach create and use a database of the same name.

You can't connect to a database that doesn't exist in postgres, so having
postgres connect to the "defaultdb" database that cockroach uses would
require changing something to first create that before it connected,
and the current stuff isn't designed to do that. (There's probably a
way to do it in the docker image, but this is just as easy.)

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@blathers-crl
Copy link

blathers-crl bot commented Apr 21, 2020

❌ The GitHub CI (Cockroach) build has failed on c1ddc697.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

:lgtm:

I tried to run this test manually at some point, and I believe I ran into the problem (and others you have fixed) you're describing, but this is where I stopped.

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@maddyblue
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 21, 2020

Build failed (retrying...)

@craig
Copy link
Contributor

craig bot commented Apr 21, 2020

Build failed (retrying...)

@craig
Copy link
Contributor

craig bot commented Apr 21, 2020

Build failed (retrying...)

@craig
Copy link
Contributor

craig bot commented Apr 21, 2020

Build failed (retrying...)

@craig
Copy link
Contributor

craig bot commented Apr 21, 2020

Build failed (retrying...)

craig bot pushed a commit that referenced this pull request Apr 21, 2020
47761: util/log: fix lying comment r=andreimatei a=andreimatei

SetExitFunc() claimed that a nil function was a way to reset it. It
wasn't; it'd lead to a crash.

Release note: None

47768: compose: have cockroach use the "postgres" database r=mjibson a=mjibson

This is needed because postgres can't do cross-database queries. So,
we'll just use the default "postgres" database since it exists at startup,
and have cockroach create and use a database of the same name.

You can't connect to a database that doesn't exist in postgres, so having
postgres connect to the "defaultdb" database that cockroach uses would
require changing something to first create that before it connected,
and the current stuff isn't designed to do that. (There's probably a
way to do it in the docker image, but this is just as easy.)

Release note: None

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
Co-authored-by: Matt Jibson <matt.jibson@gmail.com>
@craig
Copy link
Contributor

craig bot commented Apr 21, 2020

Build failed (retrying...)

@craig
Copy link
Contributor

craig bot commented Apr 21, 2020

Build failed

This is needed because postgres can't do cross-database queries. So,
we'll just use the default "postgres" database since it exists at startup,
and have cockroach create and use a database of the same name.

You can't connect to a database that doesn't exist in postgres, so having
postgres connect to the "defaultdb" database that cockroach uses would
require changing something to first create that before it connected,
and the current stuff isn't designed to do that. (There's probably a
way to do it in the docker image, but this is just as easy.)

Release note: None
@maddyblue
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 22, 2020

Build succeeded

@craig craig bot merged commit 91db3e2 into cockroachdb:master Apr 22, 2020
@maddyblue maddyblue deleted the compare-pg-db branch April 22, 2020 16:32
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