Postgresql: How to avoid encoding issues when copying a schema from one server to another? ...

Why is Nikon 1.4g better when Nikon 1.8g is sharper?

How were pictures turned from film to a big picture in a picture frame before digital scanning?

What would you call this weird metallic apparatus that allows you to lift people?

How does the math work when buying airline miles?

How do I find out the mythology and history of my Fortress?

Why are vacuum tubes still used in amateur radios?

Why weren't discrete x86 CPUs ever used in game hardware?

AppleTVs create a chatty alternate WiFi network

Effects on objects due to a brief relocation of massive amounts of mass

What is "gratricide"?

What was the first language to use conditional keywords?

What does it mean that physics no longer uses mechanical models to describe phenomena?

Is it possible for SQL statements to execute concurrently within a single session in SQL Server?

How fail-safe is nr as stop bytes?

Quadrilaterals with equal sides

What's the meaning of "fortified infraction restraint"?

Did Mueller's report provide an evidentiary basis for the claim of Russian govt election interference via social media?

How to get all distinct words within a set of lines?

Why do early math courses focus on the cross sections of a cone and not on other 3D objects?

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

How to draw/optimize this graph with tikz

Trademark violation for app?

Triggering an ultrasonic sensor

Using audio cues to encourage good posture



Postgresql: How to avoid encoding issues when copying a schema from one server to another?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Move postgresql database from one server to anotherPostgreSQL: How to backup only One Schema from a database and restore it on another serverPostgreSQL, PostGIS: Copying a schema with a geometry columnHow to restore postgreSQL schema dump to schema with different namepg_restore: [archiver (db)] could not execute query: ERROR: schema “public” already existsWhat is the impact of LC_CTYPE on a PostgreSQL database?How to transfer table from one database to another in postgresqlRetrieving database dump after copying from remote serverhow to automatically create the associated schema when I `pg_restore` a table?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















I am using pg_dump and pg_restore to move a schema from one Postgresql 9.5 server to another. On the destination server:



$ pg_dump -h source.example.com -n my_schema -v --no-owner -F c -f my_schema.dump
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
...
pg_dump: saving encoding = UTF8
(dump completes with no other errors or warnings)

$ pg_restore -h 127.0.0.1 -e -v --no-owner -d my_db my_schema.dump
...
perl: warning: Falling back to the standard locale ("C").
...
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2211; 0 6549333 TABLE DATA mention chicken
pg_restore: [archiver (db)] COPY failed for table "mention": ERROR: invalid byte sequence for encoding "UTF8": 0xcd 0x2e


Any idea how to solve this issue? What I really want is an exact binary copy of the data. The fact that there seems to be some encoding problem makes me very nervous that what is restored might not be exactly the same as the dump, even if I don't get any errors.










share|improve this question














bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    3















    I am using pg_dump and pg_restore to move a schema from one Postgresql 9.5 server to another. On the destination server:



    $ pg_dump -h source.example.com -n my_schema -v --no-owner -F c -f my_schema.dump
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = (unset)
    are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    ...
    pg_dump: saving encoding = UTF8
    (dump completes with no other errors or warnings)

    $ pg_restore -h 127.0.0.1 -e -v --no-owner -d my_db my_schema.dump
    ...
    perl: warning: Falling back to the standard locale ("C").
    ...
    pg_restore: [archiver (db)] Error while PROCESSING TOC:
    pg_restore: [archiver (db)] Error from TOC entry 2211; 0 6549333 TABLE DATA mention chicken
    pg_restore: [archiver (db)] COPY failed for table "mention": ERROR: invalid byte sequence for encoding "UTF8": 0xcd 0x2e


    Any idea how to solve this issue? What I really want is an exact binary copy of the data. The fact that there seems to be some encoding problem makes me very nervous that what is restored might not be exactly the same as the dump, even if I don't get any errors.










    share|improve this question














    bumped to the homepage by Community 9 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      3












      3








      3


      1






      I am using pg_dump and pg_restore to move a schema from one Postgresql 9.5 server to another. On the destination server:



      $ pg_dump -h source.example.com -n my_schema -v --no-owner -F c -f my_schema.dump
      perl: warning: Setting locale failed.
      perl: warning: Please check that your locale settings:
      LANGUAGE = (unset),
      LC_ALL = (unset),
      LC_CTYPE = "UTF-8",
      LANG = (unset)
      are supported and installed on your system.
      perl: warning: Falling back to the standard locale ("C").
      ...
      pg_dump: saving encoding = UTF8
      (dump completes with no other errors or warnings)

      $ pg_restore -h 127.0.0.1 -e -v --no-owner -d my_db my_schema.dump
      ...
      perl: warning: Falling back to the standard locale ("C").
      ...
      pg_restore: [archiver (db)] Error while PROCESSING TOC:
      pg_restore: [archiver (db)] Error from TOC entry 2211; 0 6549333 TABLE DATA mention chicken
      pg_restore: [archiver (db)] COPY failed for table "mention": ERROR: invalid byte sequence for encoding "UTF8": 0xcd 0x2e


      Any idea how to solve this issue? What I really want is an exact binary copy of the data. The fact that there seems to be some encoding problem makes me very nervous that what is restored might not be exactly the same as the dump, even if I don't get any errors.










      share|improve this question














      I am using pg_dump and pg_restore to move a schema from one Postgresql 9.5 server to another. On the destination server:



      $ pg_dump -h source.example.com -n my_schema -v --no-owner -F c -f my_schema.dump
      perl: warning: Setting locale failed.
      perl: warning: Please check that your locale settings:
      LANGUAGE = (unset),
      LC_ALL = (unset),
      LC_CTYPE = "UTF-8",
      LANG = (unset)
      are supported and installed on your system.
      perl: warning: Falling back to the standard locale ("C").
      ...
      pg_dump: saving encoding = UTF8
      (dump completes with no other errors or warnings)

      $ pg_restore -h 127.0.0.1 -e -v --no-owner -d my_db my_schema.dump
      ...
      perl: warning: Falling back to the standard locale ("C").
      ...
      pg_restore: [archiver (db)] Error while PROCESSING TOC:
      pg_restore: [archiver (db)] Error from TOC entry 2211; 0 6549333 TABLE DATA mention chicken
      pg_restore: [archiver (db)] COPY failed for table "mention": ERROR: invalid byte sequence for encoding "UTF8": 0xcd 0x2e


      Any idea how to solve this issue? What I really want is an exact binary copy of the data. The fact that there seems to be some encoding problem makes me very nervous that what is restored might not be exactly the same as the dump, even if I don't get any errors.







      postgresql pg-dump pg-restore






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 6 '16 at 8:59









      David TinkerDavid Tinker

      24225




      24225





      bumped to the homepage by Community 9 mins 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 9 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          This looks like you are migrating from one OS to another (like Linux / Windows or something like it), because different OSes have different names for locales.



          One way I would do it is to find out the exact locale name on the target system which corresponds to the one on the source, then use a text dump (the "normal" output of pg_dump) and on the target system, use psql to log in and set the "client encoding" to whatever the locale name from the first step is, then load the dump with i.






          share|improve this answer
























            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
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f148890%2fpostgresql-how-to-avoid-encoding-issues-when-copying-a-schema-from-one-server-t%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









            0














            This looks like you are migrating from one OS to another (like Linux / Windows or something like it), because different OSes have different names for locales.



            One way I would do it is to find out the exact locale name on the target system which corresponds to the one on the source, then use a text dump (the "normal" output of pg_dump) and on the target system, use psql to log in and set the "client encoding" to whatever the locale name from the first step is, then load the dump with i.






            share|improve this answer




























              0














              This looks like you are migrating from one OS to another (like Linux / Windows or something like it), because different OSes have different names for locales.



              One way I would do it is to find out the exact locale name on the target system which corresponds to the one on the source, then use a text dump (the "normal" output of pg_dump) and on the target system, use psql to log in and set the "client encoding" to whatever the locale name from the first step is, then load the dump with i.






              share|improve this answer


























                0












                0








                0







                This looks like you are migrating from one OS to another (like Linux / Windows or something like it), because different OSes have different names for locales.



                One way I would do it is to find out the exact locale name on the target system which corresponds to the one on the source, then use a text dump (the "normal" output of pg_dump) and on the target system, use psql to log in and set the "client encoding" to whatever the locale name from the first step is, then load the dump with i.






                share|improve this answer













                This looks like you are migrating from one OS to another (like Linux / Windows or something like it), because different OSes have different names for locales.



                One way I would do it is to find out the exact locale name on the target system which corresponds to the one on the source, then use a text dump (the "normal" output of pg_dump) and on the target system, use psql to log in and set the "client encoding" to whatever the locale name from the first step is, then load the dump with i.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 14 '16 at 14:58









                Ivan VorasIvan Voras

                27019




                27019






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f148890%2fpostgresql-how-to-avoid-encoding-issues-when-copying-a-schema-from-one-server-t%23new-answer', 'question_page');
                    }
                    );

                    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







                    Popular posts from this blog

                    Parapolítica Índice Antecedentes El escándalo Proceso judicial Consecuencias Véase...

                    How to remove border from elements in the last row?Targeting flex items on the last rowHow to vertically wrap...

                    Does an increasing sequence of reals converge if the difference of consecutive terms approaches zero?Bounded...