Re: [HACKERS] Modifying COPY TO

2005-02-25 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > ... ISTM there's far more use for copying from a query > result that just copying by index order. Yeah. The other point is that it's entirely likely that an external sort will be faster than using an indexscan to produce the sorted order. If you instea

Re: [HACKERS] Modifying COPY TO

2005-02-25 Thread Andrew - Supernews
On 2005-02-25, "Dave Held" <[EMAIL PROTECTED]> wrote: > A possibility that I would like to pursue is to keep the staging data > from the previous day, do a COPY TO, import the new data into > another staging table with a COPY FROM, then export the fresh > data with another COPY TO. Then, I can wri

Re: [HACKERS] Modifying COPY TO

2005-02-25 Thread Bruce Momjian
Jim C. Nasby wrote: > Instead of just being able to specify an index to use, how hard would it > be to allow COPY TO to work from a generic query instead of just a > table? That way you wouldn't need to do a diff, you could just export > only new records. ISTM there's far more use for copying from

Re: [HACKERS] Modifying COPY TO

2005-02-25 Thread Jim C. Nasby
Instead of just being able to specify an index to use, how hard would it be to allow COPY TO to work from a generic query instead of just a table? That way you wouldn't need to do a diff, you could just export only new records. ISTM there's far more use for copying from a query result that just cop

Re: [HACKERS] Modifying COPY TO

2005-02-25 Thread Stephen Frost
* Dave Held ([EMAIL PROTECTED]) wrote: > A possibility that I would like to pursue is to keep the staging data > from the previous day, do a COPY TO, import the new data into > another staging table with a COPY FROM, then export the fresh > data with another COPY TO. Then, I can write a fast C/C++

Re: [HACKERS] Modifying COPY TO

2005-02-25 Thread Tom Lane
"Dave Held" <[EMAIL PROTECTED]> writes: > I am interested in hacking COPY TO such that one can specify that > rows are copied in a certain index order. I got as far as=20 > src/backend/commands/copy.c:CopyTo(), and it looks like I would need > to modify the call to heap_beginscan() so that it uses

[HACKERS] Modifying COPY TO

2005-02-25 Thread Dave Held
Title: Modifying COPY TO I am interested in hacking COPY TO such that one can specify that rows are copied in a certain index order.  I got as far as src/backend/commands/copy.c:CopyTo(), and it looks like I would need to modify the call to heap_beginscan() so that it uses a key.  However