{"id":19987474,"url":"https://github.com/schibsted/copyfield","last_synced_at":"2026-04-18T12:33:47.792Z","repository":{"id":219681792,"uuid":"624922785","full_name":"schibsted/copyfield","owner":"schibsted","description":"Update fields in a PostgreSQL database with values from another column","archived":false,"fork":false,"pushed_at":"2023-04-07T17:02:18.000Z","size":91,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-08T21:39:55.789Z","etag":null,"topics":["go","postgresql","utility"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schibsted.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-07T15:42:27.000Z","updated_at":"2023-04-07T18:08:59.000Z","dependencies_parsed_at":"2024-01-29T06:13:15.996Z","dependency_job_id":null,"html_url":"https://github.com/schibsted/copyfield","commit_stats":null,"previous_names":["schibsted/copyfield"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/schibsted/copyfield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Fcopyfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Fcopyfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Fcopyfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Fcopyfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schibsted","download_url":"https://codeload.github.com/schibsted/copyfield/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2Fcopyfield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31969762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","postgresql","utility"],"created_at":"2024-11-13T04:36:31.618Z","updated_at":"2026-04-18T12:33:47.756Z","avatar_url":"https://github.com/schibsted.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Copyfield [![Build](https://github.com/schibsted/copyfield/actions/workflows/build.yml/badge.svg)](https://github.com/schibsted/copyfield/actions/workflows/build.yml)\n\nCopy a value from one field in a table, to another field in the same table, in a PostgreSQL database.\n\nThe entire process can be stopped with `ctrl-c` and resumed by running the command again, since the progress is stored in `progress.txt`.\n\n### Installation\n\nRequires Go \u003e= 1.17:\n\n    go install github.com/schibsted/copyfield@latest\n\n### Example use\n\nNOTE: Replace `PASSWORD` with your password, for all commands below.\n\nCopy values from the \"transactional\" field to the \"shipping\" field:\n\n    copyfield -dbname feedback -host 127.0.0.1 -port 5433 -password PASSWORD -table trade -src transactional -dst shipping -user feedback_user -id trade_id\n\nCopy values from the \"transactional\" field to the \"shipping\" field, and create the \"shipping\" column first if it does not exist:\n\n    copyfield -dbname feedback -host 127.0.0.1 -port 5433 -password PASSWORD -table trade -src transactional -dst shipping -user feedback_user -id trade_id -newcol \"BOOLEAN DEFAULT FALSE NOT NULL\"\n\nExamine values:\n\n    psql -h localhost -p 5433 --username=feedback_user feedback\n\nFor servers that are not running on localhost, adding `-sslmode=1` is most likely needed.\n\n### Reset the counter and remove a column\n\nRemove the file with the overview of the current progress:\n\n    rm progress.txt\n\nAlso drop the column, if needed (replace `\u003ctable\u003e` and `\u003ccol\u003e` with your own):\n\n    ALTER TABLE \u003ctable\u003e DROP COLUMN \u003ccol\u003e;\n\n### Progress\n\nThe progress is stored as a list of table indices in `index.txt`. The file is written to (flushed) every time a row in the database has been modified.\n\n### General info\n\n* Author: Alexander F. Rødseth\n* License: [Apache 2](LICENSE)\n* Version: 1.0.1\n\n### The contents of the NOTICE file\n\n(Required, per company policy).\n\n```\n################################################################################\n#                                                                              #\n# Copyfield                                                                    #\n#                                                                              #\n# Copyright 2023 Schibsted                                                     #\n#                                                                              #\n# Unless required by applicable law or agreed to in writing, software          #\n# distributed under the License is distributed on an \"AS IS\" BASIS,            #\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.     #\n#                                                                              #\n# See the License for the specific language governing permissions and          #\n# limitations under the License.                                               #\n#                                                                              #\n################################################################################\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschibsted%2Fcopyfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschibsted%2Fcopyfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschibsted%2Fcopyfield/lists"}