Re: [GENERAL] Simplyfying many equals in a join

2004-02-26 Thread cnliou
>Is there a shorthand notation when performing a multi-table join and one >column is to be equaled in all tables? Is this you are looking for? SELECT t1.c7,t2.c6 FROM t1,t2 USING (c1,c2,c3) WHERE t1.c4='2004-2-28' AND t2.c5='xyz' performs the same as SELECT t1.c7,t2.c6 FROM t1,t2 WHERE t1.c1=t

Re: [GENERAL] Case of strings

2004-02-27 Thread cnliou
>Is there anyway I can force the PgSQL to accept case equivalence, or must I >add upper()/lower() to force the case and then make string tests? > > > >Ie Where upper(A)=upper('String') I think you already answered your own question as pgsql document does in section "9.4. String Functions and

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread cnliou
> I don't think oid order would help, because what > happens if you've say got a trigger and then want > to add another before it? I'd guess the most > general way would be to give triggers some kind of > numeric ordering not associated with anything else, > but then you need ways to set it on cr

[GENERAL] Temp Table In SQL Function

2001-09-07 Thread cnliou
Hello! I am trying to create a sql function that returns 2 values using temporary table as the "media": database1=# CREATE FUNCTION SaveNumeric(int2,int2) RETURNS INTEGER AS ' database1'# CREATE TEMP TABLE mytemp(a int2,b int2); database1'# INSERT INTO mytemp VALUES ($1+1,$2+100); database1'#

Re: [GENERAL] How to implement transaction in plpgsql?

2001-09-14 Thread cnliou
If I remember correctly, the document in "function" section sas that people can not use transaction statements (begin, commit, rollback) IN any function. Instead, we should use these transaction statements OUTSIDE function. Good luck. CN

Re: [GENERAL] need help

2001-09-14 Thread cnliou
> Once we start a Postmaster process, will it keep running forever? It will if you run it in background like postmaste -i -D /home/mydir/pgsql-database-dir & > How can we restart/stop??(the commands???) The preferred command might be pg_ctl that comes along with postgresql distribution: pg_c

Re: [GENERAL] cache lookup failed

2001-09-14 Thread cnliou
Suppose you create a function function1 and a trigger that calls function1. Then you drop function1 and re-create function1. Now you will find that the trigger can't see function1's existence. trigger (and other object too) refeerences functions using OID, not the function name. I also feel it b

Re: [GENERAL] plpgsql/cursor

2001-09-14 Thread cnliou
> can i declare and fetch from a cursor inside a plpgsql function? (pg version 7.0.3) In 7.1, the pl/pgsql document says you can code like this: DECLARE rec record; BEGIN for rec in SELECT * from MyTable LOOP update tableX set tableX=rec.fieldA; END LOOP; END; CN --

[GENERAL] TIMEZONE not working?

2003-11-26 Thread cnliou
Hi! If I correctly understand v7.4 manual, value, say, '2003-11-26 12:00' in TIMESTAMP WITHOUT TIMEZONE column should output '2003-11-26 19:00' for "+08:00" timezone. The following test results seem to be somewhat unexpected. Restting OS timezone (/etc/timezone and /etc/localtime in Linux) do

Re: [GENERAL] TIMEZONE not working?

2003-11-26 Thread cnliou
Hello! Tom, >Not at all. TIMESTAMP WITHOUT TIMEZONE will not react to timezone >environment at all. Absolutely right! I seemed to have trouble understanding lengthy, though good, documentation. Here are some minor issues I have encountered: - SQL commands like "SET TIMEZONE TO NZDT" are ille

Re: [GENERAL] PostgreSQL is much faster than MySQL, only when...

2003-11-26 Thread cnliou
>> I'm curious as to what type of application you run and what first >> prompted you to switch to postgresql? I would like to add my 2 cents to this although I have not been asked by anyone about this :-) If I remember correctly the fact about 7 years ago... when PostgreSQL already supported -

Re: [GENERAL] PostgreSQL Advocacy, Thoughts and Comments

2003-11-28 Thread cnliou
"Jason Tesser" <[EMAIL PROTECTED]> > MySQL cannot even handle sub-queries yet. Ohh! Really? Allow me to pay my highest respect to the genius mySQL programmers! I completely have no clue on how to construct any single tiny database on a DBMS having no sub-query capability. Being too dumb, I sol