Re: [GENERAL] Best import approach? Delimiters in strings

2013-02-16 Thread Andrew Taylor
andle this directly? Thanks On 16 Feb 2013 17:02, "Andrew Taylor" wrote: > Hi, > > A bulk import (script attached) is failing. > > Error message: > psql:/home/andyt/projects/django-stringer/txc/stops_inport.txt:86: ERROR: > invalid input syntax for type double p

[GENERAL] Best import approach? Delimiters in strings

2013-02-16 Thread Andrew Taylor
Hi, A bulk import (script attached) is failing. Error message: psql:/home/andyt/projects/django-stringer/txc/stops_inport.txt:86: ERROR: invalid input syntax for type double precision: "stop_lat" I think the reason may be a delimiters in strings such as "Golders Green, Golders Green, stop GW"

[GENERAL] Join query query

2013-02-13 Thread Andrew Taylor
Hi, I'd like to do something which I think should be quite easy - that is join 2 tables and create a new table. Table A postcode_input has columns which include postcode, eastings, northings. there are 1,687,605 rows. Table B bng_lat_long has columns lat, lon, e, n. There are 1,687,605 rows. eas

[GENERAL] ERROR: relative path not allowed for COPY to file

2013-02-12 Thread Andrew Taylor
Hi, I must be being thick - can anyone tell me what I'm doing wrong? postgres=# COPY post_e_n postgres-# TO 'usr/local/psql/csv/post_e_n.csv' postgres-# WITH DELIMITER ',' postgres-# CSV HEADER; ERROR: relative path not allowed for COPY to file COPY (SELECT * FROM post_e_n) gave me the same err

Re: [GENERAL] Importing 120 csv files bulk multiple

2013-02-12 Thread Andrew Taylor
Awesome, thanks! On Tue, Feb 12, 2013 at 3:35 PM, Adrian Klaver wrote: > On 02/12/2013 07:14 AM, Andrew Taylor wrote: > >> Hi, >> >> As per title I need to import a load of csv files. So I wrote a bash >> script to generate the statements I needed (attached). How

[GENERAL] Importing 120 csv files bulk multiple

2013-02-12 Thread Andrew Taylor
Hi, As per title I need to import a load of csv files. So I wrote a bash script to generate the statements I needed (attached). However, this is failing on my ubuntu laptop - it seems to occasionally miss the semicolon to execute. What I did was copy the text to clipboard and paste it in to bash.

Re: [GENERAL] var/log/postgresql deletion mystery Ubuntu 12.10

2013-02-10 Thread Andrew Taylor
eb 8, 2013 at 11:43 PM, Tom Lane wrote: > Andrew Taylor writes: > > I have to create this directory each time I want to start the server. > > Something is deleting it when I close down or start up my laptop. > > > Any suggestions as to what could be doing this, or how I

[GENERAL] var/log/postgresql deletion mystery Ubuntu 12.10

2013-02-08 Thread Andrew Taylor
Hi, I have to create this directory each time I want to start the server. Something is deleting it when I close down or start up my laptop. Any suggestions as to what could be doing this, or how I could find out? I presently have version 9.1 installed. All I can add is "it used to work!". Since