![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Wouldn't it be easier to have PHP remove the first row? And PHP has to be there because Apache is sending all the data to it. Hope this helps, On Fri, Nov 19, 2004 at 03:43:18PM +0000, Adam Witney wrote: Following on from my question yesterday... Can COPY then be made to skip a header line (the first line of the file say)? The problem is this... I need to allow a user to upload a data file through a web browser (PHP driven). This is then processed and the selected file columns mapped to fields in a database, and then the data file uploaded. I can do this fine with small files.... But if I get above a 1000 rows it takes so long it time out. I can upload a 10,000 row equivalent file using COPY from psql in 2 seconds, so the time is down to the PHP processing (really all it does is send itto pg_put_Line) I liked Toms idea to create a temporary table, but I need to be able to get rid of the header row then... Is there anyway of avoiding getting PHP involved in the file processing? Any ideas? Thanks Adam -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org |
#12
| |||
| |||
|
|
Following on from my question yesterday... Can COPY then be made to skip a header line (the first line of the file say)? The problem is this... I need to allow a user to upload a data file through a web browser (PHP driven). This is then processed and the selected file columns mapped to fields in a database, and then the data file uploaded. I can do this fine with small files.... But if I get above a 1000 rows it takes so long it time out. I can upload a 10,000 row equivalent file using COPY from psql in 2 seconds, so the time is down to the PHP processing (really all it does is send itto pg_put_Line) I liked Toms idea to create a temporary table, but I need to be able to get rid of the header row then... Is there anyway of avoiding getting PHP involved in the file processing? Any ideas? Thanks Adam -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org |
|
Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them. |
#13
| |||
| |||
|
|
pg_put_Line) I liked Toms idea to create a temporary table, but I need to be able to get rid of the header row then... Is there anyway of avoiding getting PHP involved in the file processing? |
|
Any ideas? Thanks Adam |
#14
| |||
| |||
|
|
Can I get PHP to remove the first row without reading the whole file in? If there was a way where PHP would just chop the first row off that would be ideal... |

#15
| |||
| |||
|
|
can do this fine with small files.... But if I get above a 1000 rows it takes so long it time out. |
|
I can upload a 10,000 row equivalent file using COPY from psql in 2 seconds, so the time is down to the PHP processing (really all it does is send itto pg_put_Line) |
#16
| |||
| |||
|
|
Tom Lane <tgl (AT) sss (DOT) pgh.pa.us> 11/18/04 9:15 AM Adam Witney <awitney (AT) sghms (DOT) ac.uk> writes: Is it possible for the COPY command to read data from a file, but skip specific columns? |
#17
| |||
| |||
|
|
Hi Martijn, Can I get PHP to remove the first row without reading the whole file in? If there was a way where PHP would just chop the first row off that would be ideal... Thanks adam Wouldn't it be easier to have PHP remove the first row? And PHP has to be there because Apache is sending all the data to it. Hope this helps, On Fri, Nov 19, 2004 at 03:43:18PM +0000, Adam Witney wrote: Following on from my question yesterday... Can COPY then be made to skip a header line (the first line of the file say)? The problem is this... I need to allow a user to upload a data file through a web browser (PHP driven). This is then processed and the selected file columns mapped to fields in a database, and then the data file uploaded. I can do this fine with small files.... But if I get above a 1000 rows it takes so long it time out. I can upload a 10,000 row equivalent file using COPY from psql in 2 seconds, so the time is down to the PHP processing (really all it does is send itto pg_put_Line) I liked Toms idea to create a temporary table, but I need to be able to get rid of the header row then... Is there anyway of avoiding getting PHP involved in the file processing? Any ideas? Thanks Adam -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org |
#18
| |||
| |||
|
|
can do this fine with small files.... But if I get above a 1000 rows it takes so long it time out. PHP is slow, but not *that* slow, you have a problem somewhere ! |
![]() |
| Thread Tools | |
| Display Modes | |
| |