[SQL] UTF8 Vs Latin9 and valid encoding.

2006-08-29 Thread Marcelo .
Hello, I am using postgres 8.1 for windows and have the following dilema. I have 2 databases, one encoded in UTF-8 and one in Latin9. In both DBs I can create the following test table: CREATE TABLE "holaniño" ( nombre varchar(5), "titúlo" varchar(10) ) WITHOUT OIDS; Then in both DBs I can

Re: [SQL]

2006-08-29 Thread Andrew Sullivan
On Tue, Aug 29, 2006 at 12:44:28PM -0400, Sumeet wrote: > me at all. Also i tried the explain analyze and what i found was the query > execution plan keeps on changes. Is there any better way to gain control My bet is that you don't have enough sample data to support a consistent query plan. SET

Re: [SQL] to get DD-MM-YYYY format of data

2006-08-29 Thread codeWarrior
17.10.2. Locale and Formatting DateStyle (string) Sets the display format for date and time values, as well as the rules for interpreting ambiguous date input values. For historical reasons, this variable contains two independent components: the output format specification

[SQL]

2006-08-29 Thread Sumeet
Hi All,I'm having very strange problems with indexing, I have a large number of partial indexes, when i try to run some queries sometimes the queries run very fast and sometimes they are 100times slower than what i ran before.I tried running vacuum analyze couple of times and it dint help me at

Re: [SQL] Performance Problem with sub-select using array

2006-08-29 Thread Aaron Bono
On 8/28/06, Travis Whitton <[EMAIL PROTECTED]> wrote: I'm pretty sure you're right, which leads me to my next question. Is it possible to pass a column from an outer query to a subquery? For example, is there a way to do something like.SELECT owners.id AS owner_id, array(SELECT dogs.name WHERE o

Re: [SQL] Performance Problem with sub-select using array

2006-08-29 Thread Aaron Bono
Make sure you do a reply to all so you include the listOn 8/28/06, Travis Whitton <[EMAIL PROTECTED] > wrote:Ok, I actually got down to business with EXPLAIN ANALYZE. My performance was actually suffering from the DISTINCT in my SQL query and not the subquery, which I guess isn't run repeatedly

Re: [SQL] dinamic sql

2006-08-29 Thread Jaime Casanova
On 8/29/06, Manso Gomez, Ramon <[EMAIL PROTECTED]> wrote: if(user_Input = 'a') l_query := l_query||a_from_clause ||'where ename in '||user_Input else if(user_Input = 'b') l_query := l_query||b_from_clause||'where ename in '||user_Input OPEN csr FOR l_query; l_query := l_query || a_from_claus

Re: [SQL] Trigger on Insert to Update only newly inserted fields?

2006-08-29 Thread Michael Fuhr
On Mon, Aug 28, 2006 at 11:53:36AM -0400, Henry Ortega wrote: > CREATE FUNCTION updated_end_date() RETURNS trigger AS ' > BEGIN >update table set end_date=(select effective-1 from table t2 where > t2.employee=table.employee and t2.effective>table.effective order by > t2.effective limit 1); >

[SQL] dinamic sql

2006-08-29 Thread Manso Gomez, Ramon
HiI need to write a Postgres function which executes a cursor. Query of this cursor however is created on the basis of parameters passed by user.if(user_Input = 'a')l_query := l_query||a_from_clause ||'where ename in '||user_Inputelseif(user_Input = 'b')l_query := l_query||b_from_clause||'w