( Disculpad el duplicado, mande el original solo a Horacio, fallo mio ) Horacio:
On Thu, Feb 14, 2019 at 10:14 AM Horacio Miranda <hmira...@gmail.com> wrote: > una copia cerrada que no puedes usar. ( hablabamos del t0/t1, t1 es el corazon, etc... pero con el top-posting no veo como meter la cita correcta ). No recuerdo ahora, pero no podias usarla especificamente para regenerar template1? -- No tengo fuentes de esto en castellano, pero... Notes from https://www.postgresql.org/docs/11/manage-ag-templatedbs.html "template1 and template0 do not have any special status beyond the fact that the name template1 is the default source database name for CREATE DATABASE. For example, one could drop template1 and recreate it from template0 without any ill effects. This course of action might be advisable if one has carelessly added a bunch of junk in template1. (To delete template1, it must have pg_database.datistemplate = false.)" *** Editado al copiar a la lista: Tras refrescar mi memoria haciendo lo que deberia haber hecho antes ( "The Source Luke, use The Source"), he consultado https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/initdb/initdb.c;h=fd50a809ea4f0096c27b7f082dc9576f372e379e;hb=HEAD Donde claramente se ve que el orden es t1/t0: 3 * initdb --- initialize a PostgreSQL installation 4 * 5 * initdb creates (initializes) a PostgreSQL database cluster (site, 6 * instance, installation, whatever). A database cluster is a 7 * collection of PostgreSQL databases all managed by the same server. 8 * 9 * To create the database cluster, we create the directory that contains 10 * all its data, create the files that hold the global tables, create 11 * a few other control files for it, and create three databases: the 12 * template databases "template0" and "template1", and a default user 13 * database "postgres". 14 * 15 * The template databases are ordinary PostgreSQL databases. template0 16 * is never supposed to change after initdb, whereas template1 can be 17 * changed to add site-local standard data. Either one can be copied 18 * to produce a new database. 19 * 20 * For largely-historical reasons, the template1 database is the one built 21 * by the basic bootstrap process. After it is complete, template0 and 22 * the default database, postgres, are made just by copying template1. 23 * 24 * To create template1, we run the postgres (backend) program in bootstrap 25 * mode and feed it data from the postgres.bki library file. After this 26 * initial bootstrap phase, some additional stuff is created by normal 27 * SQL commands fed to a standalone backend. Some of those commands are 28 * just embedded into this program (yeah, it's ugly), but larger chunks 29 * are taken from script files. Francisco Olarte.