[SQL] How to call table returning function with other table

2006-03-19 Thread Svenne Krap
Hi. I have a function that is defined like (which works, sorry for the pseudocode) create type xxx as (id,...); create function calcuate_xxx (integer) returns xxx as $$ select $1, (select sum(amount) from bigtable where something) as a, (select sum(amount) from bigtable where

Re: [SQL] How to call table returning function with other table

2006-03-19 Thread Markus Bertheau
2006/3/19, Svenne Krap [EMAIL PROTECTED]: So it is something like select xxx(id) from othertable where otherwhere = 't' except that it mangles the columns into an array. I have tried to move the function-call into the fromlist (as it is usually done) but I seem unsuccessful in getting the

Re: [SQL] How to call table returning function with other table

2006-03-19 Thread Svenne Krap
Perfect. Thanks. Svenne Markus Bertheau wrote: 2006/3/19, Svenne Krap [EMAIL PROTECTED]: So it is something like "select xxx(id) from othertable where otherwhere = 't'" except that it mangles the columns into an array. I have tried to move the function-call into the fromlist

[SQL] Lead and tail quotes with \pset fieldsep

2006-03-19 Thread Bath, David
Folks If I want psql to generate CSV files fully-double-quoted I can use pset as follows psql \pset fieldsep , However this does not put a quote before the first field and after the last, so each row comes out as 1234,blahblah,sdfgsg,foo,bar Is there a way to use psql to give rows like

Re: [SQL] PostgreSQL Handling of Special Characters

2006-03-19 Thread Markus Bertheau
2006/3/20, Christian Paul B. Cosinas [EMAIL PROTECTED]: Let's say a character of 150 ASCII code. Which looks like a hypen. When I retrieve the value of that field it gives me a question mark character instead of that 150 ASCII code character. What could be the possible reason of this?

Re: [SQL] PostgreSQL Handling of Special Characters

2006-03-19 Thread Christian Paul B. Cosinas
Hi Markus, Can you please elaborate more on this. I'm really lost. Thank You So Much. -Original Message- From: Markus Bertheau [mailto:[EMAIL PROTECTED] Sent: Sunday, March 19, 2006 8:09 PM To: Christian Paul B. Cosinas Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] PostgreSQL Handling

Re: [SQL] PostgreSQL Handling of Special Characters

2006-03-19 Thread Eugene E.
Christian Paul B. Cosinas wrote: Hi Markus, Can you please elaborate more on this. I'm really lost. Be sure that postgresql ITSELF is handling all chars transparently except ZEROES. Look for the error in the media layer ---(end of

Re: [SQL] PostgreSQL Handling of Special Characters

2006-03-19 Thread Peter Eisentraut
Christian Paul B. Cosinas wrote: My Database uses SQL_ASCII encoding. Do yourself a favor and use something else. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner

Re: [SQL] PostgreSQL Handling of Special Characters

2006-03-19 Thread PFC
My Database uses SQL_ASCII encoding. I just received an email with all accented characters destroyed. UNICODE should be the default for anything in 2006. ---(end of broadcast)--- TIP 6: explain analyze is your friend