How can I share pg_dump output with my team so they can restore without errors?How to version control...
Does an increasing sequence of reals converge if the difference of consecutive terms approaches zero?
Why is Shelob considered evil?
Simple Question About Conservation of Angular Momentum
Why does finding small effects in large studies indicate publication bias?
Coworker is trying to get me to sign his petition to run for office. How to decline politely?
Taking an academic pseudonym?
Diagram in Tikz environment
Why would you use 2 alternate layout buttons instead of 1, when only one can be selected at once
The totem pole can be grouped into
Badly designed reimbursement form. What does that say about the company?
How to draw these kind of adjacent ovals with arrows in latex?
Workplace intimidation due to child's chronic health condition
Who, if anyone, was the first astronaut to return to earth in a different vessel?
Can a planet be tidally unlocked?
Why don't hotels offer (at least) 1 kitchen bookable by any guest?
Does human life have innate value over that of other animals?
Was Opportunity's last message to Earth "My battery is low and it's getting dark"?
Is there a technology capable of disabling the whole of Earth's satellitle network?
Sing Baby Shark
Why is Bernie Sanders maximum accepted donation on actblue $5600?
Identical projects by students at two different colleges: still plagiarism?
Apparently I’m calling random numbers but nothing in call log?
How bad is a Computer Science course that doesn't teach Design Patterns?
How to play song that contains one guitar when we have two guitarists (or more)?
How can I share pg_dump output with my team so they can restore without errors?
How to version control PostgreSQL schema with comments?issues with encoding and pg_dump/restore between windows and linuxpg_restore: [archiver (db)] could not execute query: ERROR: schema “public” already existspg_dump does not honor -nHow to make a query from a database with schemas to a database without schemas, and vice versa, with DBLINK in postgrespg_restore not restoring sequencesTurn off auto qualification of table names when creating a viewpostgres backup for specific table with blob oidDifferences between .dump and .sql in pg_dump PostgreSQLPostgres pg_restore error: invalid byte sequence for encoding “UTF8”: 0xe05c62
I am on a team that is building a Drupal website. All of the settings, including the migration scripts from the old site, will be in code, so in theory all of our work can be replicated just from a git clone
. But it is convenient to have backups of the database at various milestones so we don't have to wait on that process every time.
So I want to use pg_dump to make a backup of my database and share it with my team. They would use pg_restore to set up their databases, and life is good. Except that there are always errors or warnings from pg_restore. Whenever I try to fix one, another takes its place.
First, I used -O
so that my team doesn't have to use the same user I do. This option works the best so far, but they see warnings that they don't own PL/pgSQL or the SCHEMA "public".
I can use -n
to specify the schema, but then I have to be careful that the user owns "public", and not postgres. Maybe I should specify a different schema. Can I export the search path with pg_dump?
When developers switch branches to work on different features, some tables and rows may become invalid, so restoring to a backup should involve dropping the database, or at least the schema. -c -C
looks good, but really only works if you're a superuser, I think. This isn't immediately a terrible idea, because developers work on their own machines, but deploying to production will make that a pain, I'm sure.
Is there a best practice I can follow here? Am I over-complicating things?
postgresql pg-dump
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I am on a team that is building a Drupal website. All of the settings, including the migration scripts from the old site, will be in code, so in theory all of our work can be replicated just from a git clone
. But it is convenient to have backups of the database at various milestones so we don't have to wait on that process every time.
So I want to use pg_dump to make a backup of my database and share it with my team. They would use pg_restore to set up their databases, and life is good. Except that there are always errors or warnings from pg_restore. Whenever I try to fix one, another takes its place.
First, I used -O
so that my team doesn't have to use the same user I do. This option works the best so far, but they see warnings that they don't own PL/pgSQL or the SCHEMA "public".
I can use -n
to specify the schema, but then I have to be careful that the user owns "public", and not postgres. Maybe I should specify a different schema. Can I export the search path with pg_dump?
When developers switch branches to work on different features, some tables and rows may become invalid, so restoring to a backup should involve dropping the database, or at least the schema. -c -C
looks good, but really only works if you're a superuser, I think. This isn't immediately a terrible idea, because developers work on their own machines, but deploying to production will make that a pain, I'm sure.
Is there a best practice I can follow here? Am I over-complicating things?
postgresql pg-dump
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I am on a team that is building a Drupal website. All of the settings, including the migration scripts from the old site, will be in code, so in theory all of our work can be replicated just from a git clone
. But it is convenient to have backups of the database at various milestones so we don't have to wait on that process every time.
So I want to use pg_dump to make a backup of my database and share it with my team. They would use pg_restore to set up their databases, and life is good. Except that there are always errors or warnings from pg_restore. Whenever I try to fix one, another takes its place.
First, I used -O
so that my team doesn't have to use the same user I do. This option works the best so far, but they see warnings that they don't own PL/pgSQL or the SCHEMA "public".
I can use -n
to specify the schema, but then I have to be careful that the user owns "public", and not postgres. Maybe I should specify a different schema. Can I export the search path with pg_dump?
When developers switch branches to work on different features, some tables and rows may become invalid, so restoring to a backup should involve dropping the database, or at least the schema. -c -C
looks good, but really only works if you're a superuser, I think. This isn't immediately a terrible idea, because developers work on their own machines, but deploying to production will make that a pain, I'm sure.
Is there a best practice I can follow here? Am I over-complicating things?
postgresql pg-dump
I am on a team that is building a Drupal website. All of the settings, including the migration scripts from the old site, will be in code, so in theory all of our work can be replicated just from a git clone
. But it is convenient to have backups of the database at various milestones so we don't have to wait on that process every time.
So I want to use pg_dump to make a backup of my database and share it with my team. They would use pg_restore to set up their databases, and life is good. Except that there are always errors or warnings from pg_restore. Whenever I try to fix one, another takes its place.
First, I used -O
so that my team doesn't have to use the same user I do. This option works the best so far, but they see warnings that they don't own PL/pgSQL or the SCHEMA "public".
I can use -n
to specify the schema, but then I have to be careful that the user owns "public", and not postgres. Maybe I should specify a different schema. Can I export the search path with pg_dump?
When developers switch branches to work on different features, some tables and rows may become invalid, so restoring to a backup should involve dropping the database, or at least the schema. -c -C
looks good, but really only works if you're a superuser, I think. This isn't immediately a terrible idea, because developers work on their own machines, but deploying to production will make that a pain, I'm sure.
Is there a best practice I can follow here? Am I over-complicating things?
postgresql pg-dump
postgresql pg-dump
asked Feb 9 '15 at 18:00
IslandUsurperIslandUsurper
164
164
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It turns out I have been trying to over-simplify things. Somehow, I didn't try using both -O
and -n
until today. Now pg_restore doesn't throw errors, and my CI server will continue with tests. And it will keep my team from seeing warnings when they shouldn't.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f91516%2fhow-can-i-share-pg-dump-output-with-my-team-so-they-can-restore-without-errors%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It turns out I have been trying to over-simplify things. Somehow, I didn't try using both -O
and -n
until today. Now pg_restore doesn't throw errors, and my CI server will continue with tests. And it will keep my team from seeing warnings when they shouldn't.
add a comment |
It turns out I have been trying to over-simplify things. Somehow, I didn't try using both -O
and -n
until today. Now pg_restore doesn't throw errors, and my CI server will continue with tests. And it will keep my team from seeing warnings when they shouldn't.
add a comment |
It turns out I have been trying to over-simplify things. Somehow, I didn't try using both -O
and -n
until today. Now pg_restore doesn't throw errors, and my CI server will continue with tests. And it will keep my team from seeing warnings when they shouldn't.
It turns out I have been trying to over-simplify things. Somehow, I didn't try using both -O
and -n
until today. Now pg_restore doesn't throw errors, and my CI server will continue with tests. And it will keep my team from seeing warnings when they shouldn't.
answered Feb 13 '15 at 18:33
IslandUsurperIslandUsurper
164
164
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f91516%2fhow-can-i-share-pg-dump-output-with-my-team-so-they-can-restore-without-errors%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown