[GENERAL] ROWTYPE inserts

2008-10-09 Thread chrisj
In the 8.3 manual section 38.3.3 it shows a great short cut using ROWTYPEs for selects: CREATE FUNCTION merge_fields(t_row table1) RETURNS text AS $$ DECLARE t2_row table2%ROWTYPE; BEGIN SELECT * INTO t2_row FROM table2 WHERE ... ; It seems to me there should be a corresponding short cut usi

Re: [GENERAL] tsearch2 and english locale on Debian - english.0 english.1

2007-04-29 Thread chrisj
found it at : http://ftp.gnu.mirrors.hoobly.com/gnu/non-gnu/ispell/ chrisj wrote: > > Hi, the tsearch2 intro has instructions for creating a US_en locale, here > is a snippet: > > .. it can be created from the /languages/english directory with the > following command: >

[GENERAL] tsearch2 and english locale on Debian - english.0 english.1

2007-04-28 Thread chrisj
Hi, the tsearch2 intro has instructions for creating a US_en locale, here is a snippet: .. it can be created from the /languages/english directory with the following command: sort -u -t/ +0f -1 +0 -T /usr/tmp -o english.med english.0 english.1 The problem is that the files english.0 and

Re: [GENERAL] selective export for subsequent import (COPY)

2007-04-23 Thread chrisj
Wow, how did you discover that? Andrew Kroeger wrote: > > Tom Lane wrote: >> chrisj <[EMAIL PROTECTED]> writes: >>> This helped a lot, but ideally I want a tab field delimiter and -F '\t' >>> does >>> not seem to work, any ideas?? &

Re: [GENERAL] selective export for subsequent import (COPY)

2007-04-20 Thread chrisj
Hi Tom, It appears to me that the documentation suggests that: -P fieldsep='\t' should work, but I don't think it does. Tom Lane-2 wrote: > > chrisj <[EMAIL PROTECTED]> writes: >> This helped a lot, but ideally I want a tab field delimiter and -F 

Re: [GENERAL] selective export for subsequent import (COPY)

2007-04-20 Thread chrisj
Thanks Brent, very much appreciated, your first suggestion is perfect. the translate suggestion assumes that there are no commas in the data, but that is why I wanted to use tab. again, thanks a lot!! Brent Wood wrote: > > chrisj wrote: >> Thanks Alan, >> This helped a

Re: [GENERAL] selective export for subsequent import (COPY)

2007-04-19 Thread chrisj
Thanks Alan, This helped a lot, but ideally I want a tab field delimiter and -F '\t' does not seem to work, any ideas?? I noticed one other post on this same problem of the fieldsep '\t' not working but the only advise offered was to use \pset. Can \pset be used on the command line, I can only g

[GENERAL] selective export for subsequent import (COPY)

2007-04-18 Thread chrisj
I would like to do a selective export of a number of tables from a large database to import into a smaller (test) DB. I know about: psql dbname -tc "select * from tableX where whatever" > tableX.dat but unless I put it through a sed script, this file cannot be easily used for import. It feels

[GENERAL] is there a way to determine the attributes of anyelement

2007-04-11 Thread chrisj
I have written a simple procedure that accepts anyarray, and concatinates the elements separated by a space and returns the result to anyelement. I know when I call this function I will always be passing varchars. If the length of the resultant concatination is longer than the maximum length of