Re: [GENERAL] Using psql to feed a file line by line to a table column

2013-03-14 Thread Ian Lawrence Barwick
2013/3/14 Alexander Farber : > Thank you - > > On Thu, Mar 14, 2013 at 10:40 AM, Ian Lawrence Barwick > wrote: >>> I also have an INSERT trigger on my table, >>> can I return a NULL from it or something similar? >> >> Yes, if you test for the presence of the word you can return NULL >> and the row

Re: [GENERAL] Using psql to feed a file line by line to a table column

2013-03-14 Thread Alexander Farber
Thank you - On Thu, Mar 14, 2013 at 10:40 AM, Ian Lawrence Barwick wrote: >> I also have an INSERT trigger on my table, >> can I return a NULL from it or something similar? > > Yes, if you test for the presence of the word you can return NULL > and the row will be discarded. See example below. >

Re: [GENERAL] Using psql to feed a file line by line to a table column

2013-03-14 Thread Ian Lawrence Barwick
2013/3/13 Alexander Farber : > Thank you, this was indeed the > (uneeded) semicolon at end of the COPY line. > > May I ask another question - (...) > When I add few more words to my text file > and then try to load it into my table again, > then the COPY command will fail, > because of the already

Re: [GENERAL] Using psql to feed a file line by line to a table column

2013-03-13 Thread Alexander Farber
Thank you, this was indeed the (uneeded) semicolon at end of the COPY line. May I ask another question - On Tue, Mar 12, 2013 at 6:24 PM, Ian Lawrence Barwick wrote: >>> 2013/3/13 Alexander Farber : I have a list of 40 non-english words, each on a separate line and in UTF8 for

Re: [GENERAL] Using psql to feed a file line by line to a table column

2013-03-12 Thread Ian Lawrence Barwick
2013/3/13 Alexander Farber : > Unfortunately doesn't work - > > On Tue, Mar 12, 2013 at 5:53 PM, Ian Lawrence Barwick > wrote: >> 2013/3/13 Alexander Farber : >>> >>> I have a list of 40 non-english words, >>> each on a separate line and in UTF8 format, >>> which I'd like to put in the "word"

Re: [GENERAL] Using psql to feed a file line by line to a table column

2013-03-12 Thread Alexander Farber
Unfortunately doesn't work - On Tue, Mar 12, 2013 at 5:53 PM, Ian Lawrence Barwick wrote: > 2013/3/13 Alexander Farber : >> >> I have a list of 40 non-english words, >> each on a separate line and in UTF8 format, >> which I'd like to put in the "word" column >> of the following table (also in

Re: [GENERAL] Using psql to feed a file line by line to a table column

2013-03-12 Thread Ian Lawrence Barwick
2013/3/13 Alexander Farber : > Hello, > > I have a list of 40 non-english words, > each on a separate line and in UTF8 format, > which I'd like to put in the "word" column > of the following table (also in UTF8 and 8.4.13): > > create table good_words ( > word varchar(64) primary key, >

[GENERAL] Using psql to feed a file line by line to a table column

2013-03-12 Thread Alexander Farber
Hello, I have a list of 40 non-english words, each on a separate line and in UTF8 format, which I'd like to put in the "word" column of the following table (also in UTF8 and 8.4.13): create table good_words ( word varchar(64) primary key, verified boolean not null default fals