[SQL] lo_import

2012-01-03 Thread Maurício Cruz
Hi all, I'm trying to use lo_import to import a file into my database, if I execute from postgres runing in my local machine it works perfectly, but if I do it in the postgres runing in the server, it says "No such file or directory" I Guess postgres only see file on the machine it is runing

Re: [SQL] lo_import

2012-01-03 Thread Tim Landscheidt
Maurício Cruz wrote: > I'm trying to use lo_import to import a file into my > database, if I execute from postgres runing in my local > machine > it works perfectly, but if I do it in the postgres runing in > the server, it says "No such file or directory" > I Guess postgres only see file on the

Re: [SQL] lo_import

2012-01-03 Thread Jasen Betts
On 2012-01-03, Maurício Cruz wrote: > Hi all, > > I'm trying to use lo_import to import a file into my database, if I > execute from postgres runing in my local machine > it works perfectly, but if I do it in the postgres runing in the server, > it says "No such file or directory" > > I Guess po

[SQL] ignore unique violation OR check row exists

2012-01-03 Thread rverghese
I want to insert a bunch of records and not do anything if the record already exists. So the 2 options I considered are 1) check if row exists or insert and 2) ignore the unique violation on insert if row exists. Any opinions on whether it is faster to INSERT and then catch the UNIQUE VIOLATION ex

Re: [SQL] ignore unique violation OR check row exists

2012-01-03 Thread Misa Simic
If exists is better, though insert line by line and check if exists may be very slow... The best would be if you can use copy command from csv to staging table (without constraints) and then Insert to live from stage where stage constraint column not exist in live... Kind Regards, Misa Sent fr