Re: Split copy.c

2020-11-23 Thread Heikki Linnakangas
On 18/11/2020 08:21, Soumyadeep Chakraborty wrote: On Tue, Nov 17, 2020 at 2:38 AM Heikki Linnakangas wrote: Fixed all the other things you listed, fixed a bug in setting 'file_encoding', and trimmed down the #includes. Thanks! LGTM! Marking as Ready for Committer. Pushed, thanks for the

Re: Split copy.c

2020-11-16 Thread Heikki Linnakangas
Linnakangas wrote: There isn't much common code between COPY FROM and COPY TO, so I propose that we split copy.c into two: copyfrom.c and copyto.c. See attached. I thin that's much nicer. Not quite convinced that's the right split - or perhaps there's just more potential. My feeling

Re: Split copy.c

2020-11-15 Thread Justin Pryzby
3:29 +0200, Heikki Linnakangas wrote: > > > > > There isn't much common code between COPY FROM and COPY TO, so I > > > > > propose > > > > > that we split copy.c into two: copyfrom.c and copyto.c. See attached. > > > > > I thin > > > &g

Re: Split copy.c

2020-11-11 Thread Soumyadeep Chakraborty
Hey Heikki, On Tue, Nov 3, 2020 at 1:30 AM Heikki Linnakangas wrote: Thanks for working on this refactor. LGTM! I had a few minor comments: 1. We should rename the CopyFormatOptions *cstate param in ProcessCopyOptions() to CopyFormatOptions *options and List *options to List *raw_options IMO,

Re: Split copy.c

2020-11-03 Thread Erikjan Rijkers
On 2020-11-03 08:38, Heikki Linnakangas wrote: [v3-0001-Split-copy.c-into-copyto.c-and-copyfrom.c.patch] [v3-0002-Split-copyfrom.c-further-into-copyfrom.c-and-copy.patch] The patches apply ok, but I get these errors: In file included from ../../../src/include/postgres.h:46

Re: Split copy.c

2020-11-02 Thread David Rowley
tween COPY FROM and COPY TO, so I propose > > > > that we split copy.c into two: copyfrom.c and copyto.c. See attached. I > > > > thin > > > > that's much nicer. > > > > > > Not quite convinced that's the right split - or perhaps there's just > >

Re: Split copy.c

2020-11-02 Thread Andres Freund
On 2020-11-02 19:43:38 +0200, Heikki Linnakangas wrote: > On 02/11/2020 19:23, Andres Freund wrote: > > On 2020-11-02 11:03:29 +0200, Heikki Linnakangas wrote: > > > There isn't much common code between COPY FROM and COPY TO, so I propose > > > that we split

Re: Split copy.c

2020-11-02 Thread Heikki Linnakangas
On 02/11/2020 19:23, Andres Freund wrote: On 2020-11-02 11:03:29 +0200, Heikki Linnakangas wrote: There isn't much common code between COPY FROM and COPY TO, so I propose that we split copy.c into two: copyfrom.c and copyto.c. See attached. I thin that's much nicer. Not quite convinced that's

Re: Split copy.c

2020-11-02 Thread Andres Freund
Hi, On 2020-11-02 11:03:29 +0200, Heikki Linnakangas wrote: > While looking at the parallel copy patches, it started to annoy me how large > copy.c is. Agreed. > There isn't much common code between COPY FROM and COPY TO, so I propose > that we split copy.c into two: copyfrom.c

Re: Split copy.c

2020-11-02 Thread vignesh C
rontend (2.0 protocol) */ COPY_NEW_FE, /* to frontend (3.0 protocol) */ } CopyDest; Should we have one enum or both are required, if both are required we could think of naming like COPY_TO_FILE, COPY_FROM_FILE, it will make it more clearer. There is one warning while applying the v2 patch:

Re: Split copy.c

2020-11-02 Thread Erik Rijkers
in the past, but I haven't done anything about it.) [0001-Split-copy.c-into-...o.c-and-copyfrom.c.patch] There seems to be an oversight of contrib/file_fdw. (debian 10, gcc 8.3.0) Ah yeah, I missed updating file_fdw. Here's a new patch. Something still not quite right in the compile-with-assert

Re: Split copy.c

2020-11-02 Thread Erik Rijkers
On 2020-11-02 10:03, Heikki Linnakangas wrote: While looking at the parallel copy patches, it started to annoy me how large copy.c is. It confuses my little head. (Ok, it's annoyed me many times in the past, but I haven't done anything about it.) [0001-Split-copy.c-into-...o.c