Re: [GENERAL] Archiving data to another server using copy, psql with pipe

2017-04-06 Thread David G. Johnston
On Thu, Apr 6, 2017 at 4:24 AM, Moreno Andreo wrote: > psql -h localhost postgres -c "copy (SELECT * FROM a WHERE time < now()) to > stdout " | psql -h localhost postgres -c "copy b from stdin" ​The first question at hand is whether the source psql command will provoke an EOF (which is the o

Re: [GENERAL] Archiving data to another server using copy, psql with pipe

2017-04-06 Thread Moreno Andreo
Il 06/04/2017 16:10, pinker ha scritto: Error message says, as one could expect, that the second table has got smaller precision... The question isn't about this particular error - which was induced for purpose - but about atomicity of this operation Sorry, I read your message without paying t

Re: [GENERAL] Archiving data to another server using copy, psql with pipe

2017-04-06 Thread pinker
W dniu 2017-04-06 14:28:04 użytkownik Moreno Andreo napisał: > Il 06/04/2017 13:58, pinker ha scritto: > > > > W dniu 2017-04-06 13:24:16 użytkownik Moreno Andreo > > napisał: > >> Il 05/04/2017 23:26, pinker ha scritto: > >>> Hi, > >>> I'm trying to write an archive manager which will be fir

Re: [GENERAL] Archiving data to another server using copy, psql with pipe

2017-04-06 Thread Moreno Andreo
Il 06/04/2017 13:58, pinker ha scritto: W dniu 2017-04-06 13:24:16 użytkownik Moreno Andreo napisał: Il 05/04/2017 23:26, pinker ha scritto: Hi, I'm trying to write an archive manager which will be first copying data from tables with where clause and then, after successful load into second s

Re: [GENERAL] Archiving data to another server using copy, psql with pipe

2017-04-06 Thread pinker
W dniu 2017-04-06 13:24:16 użytkownik Moreno Andreo napisał: > Il 05/04/2017 23:26, pinker ha scritto: > > Hi, > > I'm trying to write an archive manager which will be first copying data from > > tables with where clause and then, after successful load into second server > > - delete them. > >

Re: [GENERAL] Archiving data to another server using copy, psql with pipe

2017-04-06 Thread Moreno Andreo
Il 05/04/2017 23:26, pinker ha scritto: Hi, I'm trying to write an archive manager which will be first copying data from tables with where clause and then, after successful load into second server - delete them. The simplest (and probably fastest) solution I came up with is to use copy: psql -h l

[GENERAL] Archiving data to another server using copy, psql with pipe

2017-04-05 Thread pinker
Hi, I'm trying to write an archive manager which will be first copying data from tables with where clause and then, after successful load into second server - delete them. The simplest (and probably fastest) solution I came up with is to use copy: psql -h localhost postgres -c "copy (SELECT * FROM