{"id":224,"date":"2025-02-20T16:18:47","date_gmt":"2025-02-20T16:18:47","guid":{"rendered":"https:\/\/lmponceb.com\/?p=224"},"modified":"2025-02-20T16:18:47","modified_gmt":"2025-02-20T16:18:47","slug":"carga-de-base-postgres-en-un-docker","status":"publish","type":"post","link":"https:\/\/lmponceb.com\/index.php\/2025\/02\/20\/carga-de-base-postgres-en-un-docker\/","title":{"rendered":"Carga de Base Postgres en un docker"},"content":{"rendered":"\n<p>Para trabajar localmente necesito cargar una base de datos de 20 Gb<\/p>\n\n\n\n<p><strong>Paso 1:<\/strong><\/p>\n\n\n\n<p>Copiar Script de BDD en el docker<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker cp miscript.sql micontenedor:\/miscript.sql<\/code><\/pre>\n\n\n\n<p><strong>Paso 2:<\/strong><\/p>\n\n\n\n<p>Ejecutar script de docker en base de datos<\/p>\n\n\n\n<p>docker exec -i micontenedor psql -U postgres -d mibase -f \/miscript.sql<\/p>\n\n\n\n<p><strong>Paso 3:<\/strong><\/p>\n\n\n\n<p>Podemos verificar la carga contando los registros<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT<br>schemaname AS esquema,<br>relname AS tabla,<br>n_live_tup AS total_registros<br>FROM pg_stat_user_tables<br>WHERE schemaname = 'public'<br>ORDER BY total_registros DESC;<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Para trabajar localmente necesito cargar una base de datos de 20 Gb Paso 1: Copiar Script de BDD en el docker Paso 2: Ejecutar script de docker en base de datos docker exec -i micontenedor psql -U postgres -d mibase -f \/miscript.sql Paso 3: Podemos verificar la carga contando los registros<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-224","post","type-post","status-publish","format-standard","hentry","category-postgresql"],"_links":{"self":[{"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/posts\/224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/comments?post=224"}],"version-history":[{"count":1,"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/posts\/224\/revisions"}],"predecessor-version":[{"id":225,"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/posts\/224\/revisions\/225"}],"wp:attachment":[{"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/media?parent=224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/categories?post=224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lmponceb.com\/index.php\/wp-json\/wp\/v2\/tags?post=224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}