Обсуждение: merge 2 dumps
hello all, I have 2 dumps of the same Pg database in diferent instants. I'dd like to merge the two dumps into one single dump in order to restore all data at one time. Is this possible ? are there any helper tools to aid in dealing with text dump files ? thanks Joao
Joao Ferreira gmail wrote: > hello all, > > I have 2 dumps of the same Pg database in diferent instants. > > I'dd like to merge the two dumps into one single dump in order to > restore all data at one time. Is there any overlap in the data? If so, simplest might be to restore dump1, rename all the tables, restore dump2 then run queries to rationalise your two sets of tables. -- Richard Huxton Archonet Ltd
On Tue, 2008-11-11 at 11:16 +0000, Richard Huxton wrote: > Joao Ferreira gmail wrote: > > hello all, > > > > I have 2 dumps of the same Pg database in diferent instants. > > > > I'dd like to merge the two dumps into one single dump in order to > > restore all data at one time. > > Is there any overlap in the data? no. I don't expect that there might be overlaps. any simpler solution in this case ? could I just get the "COPY TO" sections from the files and load them one after the other ? I never tried this before... j > > If so, simplest might be to restore dump1, rename all the tables, > restore dump2 then run queries to rationalise your two sets of tables. >
Joao Ferreira gmail wrote: > On Tue, 2008-11-11 at 11:16 +0000, Richard Huxton wrote: >> Joao Ferreira gmail wrote: >>> hello all, >>> >>> I have 2 dumps of the same Pg database in diferent instants. >>> >>> I'dd like to merge the two dumps into one single dump in order to >>> restore all data at one time. >> Is there any overlap in the data? > > no. I don't expect that there might be overlaps. any simpler solution in > this case ? > > could I just get the "COPY TO" sections from the files and load them one > after the other ? Great - if it's something like log data for different years that makes it much simpler. Just do a --data-only restore with the second dump, that should work just fine. -- Richard Huxton Archonet Ltd
Hello all, I have one question about converting timestamps to text. I believed that using to_char function with proper mask and casting by style COLUMN::text is equal, but when I issue following query against 8.3.3 database it returns me different values (they differ on last position of microsecconds value, maybe rounding error ?). Could please somebody tell me what is the reason ? I have tried to find some info about it on web but without success. Thanks in advance Vaclav TVRDIK WoC=> SELECT to_char(create_dat, 'YYYY-DD-MM HH24:MI:SS:US'), create_dat::text WoC-> from config WoC-> where parameter_name = 'app_server_db_conn_pooler_connections'; to_char | create_dat ----------------------------+---------------------------- 2008-02-09 12:12:15:214268 | 2008-09-02 12:12:15.214269 (1 row)
Vaclav TVRDIK <tvrdik@i3.cz> writes: > I have one question about converting timestamps to text. I believed > that using to_char function with proper mask and casting by style > COLUMN::text is equal, but when I issue following query against 8.3.3 > database it returns me different values (they differ on last position > of microsecconds value, maybe rounding error ?). Hm, I can't replicate that here --- but if you're using floating-point timestamps, as is default in 8.3, then a certain amount of machine-dependent roundoff fuzziness is not surprising. regards, tom lane
Tom Lane wrote: > Hm, I can't replicate that here --- but if you're using floating-point > timestamps, as is default in 8.3, then a certain amount of > machine-dependent roundoff fuzziness is not surprising. > > regards, tom lane > Column is defined in such way: CREATE_DAT timestamp not null default now(), but in my opinion the value is already stored in the column and then my query should return same texts because they do display the same value in the same format, shouldn't they ? Thank you Vaclav Tvrdik
Por favor no quiero seguir recibiendo mensajes Vaclav TVRDIK escribió: > Tom Lane wrote: > >> Hm, I can't replicate that here --- but if you're using floating-point >> timestamps, as is default in 8.3, then a certain amount of >> machine-dependent roundoff fuzziness is not surprising. >> >> regards, tom lane >> >> > Column is defined in such way: > CREATE_DAT timestamp not null default now(), > > but in my opinion the value is already stored in the column and then my > query should return same texts because they do display the same value in > the same format, shouldn't they ? > > Thank you > Vaclav Tvrdik > > Aviso Legal Este mensaje puede contener informacion de interes solo para CVG Venalum. Solo esta permitida su copia, distribuciono uso a personas autorizadas. Si recibio este corre por error, por favor destruyalo. Eventualmentew los correoselectonicos pueden ser alterados. Al respecto, CVG Venalum no se hace responsable por los errores que pudieran afectaral mensaje original.
Вложения
On Tuesday 11 November 2008, Joao Ferreira gmail <joao.miguel.c.ferreira@gmail.com> wrote: > could I just get the "COPY TO" sections from the files and load them one > after the other ? > > I never tried this before... You might have drop foreign keys before doing so and recreate them after - the dumps aren't careful to maintain ordering. -- Alan