merge 2 dumps

Lists: pgsql-general
From: Joao Ferreira gmail <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: merge 2 dumps
Date: 2008-11-11 10:49:32
Message-ID: 1226400572.5799.3.camel@debj4n.critical.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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


From: Richard Huxton <dev(at)archonet(dot)com>
To: Joao Ferreira gmail <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: merge 2 dumps
Date: 2008-11-11 11:16:22
Message-ID: 49196986.3000203@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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


From: Joao Ferreira gmail <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: merge 2 dumps
Date: 2008-11-11 11:52:14
Message-ID: 1226404334.5799.11.camel@debj4n.critical.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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.
>


From: Richard Huxton <dev(at)archonet(dot)com>
To: Joao Ferreira gmail <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: merge 2 dumps
Date: 2008-11-11 12:46:20
Message-ID: 49197E9C.7030705@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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


From: Vaclav TVRDIK <tvrdik(at)i3(dot)cz>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Timestamp precission question
Date: 2008-11-11 15:36:04
Message-ID: 4919A664.2000405@i3.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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)


From: Adriana Alfonzo <adriana(dot)alfonzo(at)venalum(dot)com(dot)ve>
To: Vaclav TVRDIK <tvrdik(at)i3(dot)cz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Timestamp precission question
Date: 2008-11-11 19:56:28
Message-ID: 4919E36C.2000706@venalum.com.ve
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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, distribucion o uso a personas autorizadas. Si recibio este corre por error, por favor destruyalo. Eventualmentew los correos electonicos pueden ser alterados. Al respecto, CVG Venalum no se hace responsable por los errores que pudieran afectar al mensaje original.

Attachment Content-Type Size
adriana_alfonzo.vcf text/x-vcard 293 bytes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vaclav TVRDIK <tvrdik(at)i3(dot)cz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Timestamp precission question
Date: 2008-11-11 20:16:13
Message-ID: 11686.1226434573@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Vaclav TVRDIK <tvrdik(at)i3(dot)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


From: Vaclav TVRDIK <tvrdik(at)i3(dot)cz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Timestamp precission question
Date: 2008-11-11 20:38:42
Message-ID: 4919ED52.8010807@i3.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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


From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: merge 2 dumps
Date: 2008-11-12 16:06:54
Message-ID: 200811120806.54482@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Tuesday 11 November 2008, Joao Ferreira gmail
<joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)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