[SQL] plpgsql syntax

2004-09-23 Thread Kemin Zhou
I just want to bring up a point for discussion: for the function definition is treated as a long string right now. Why not add an additional token so that we don't have to write 10 single quotes. for example create function a_func() return integer as . end a_func after as and before end a_fu

[SQL] aggregate function stddev

2004-09-08 Thread Kemin Zhou
Implementers: Just noticed that the postgres stddev is the stddev_sample formula. There are two different ways to calculate this value. Their difference is very small with large samle size. It would be nice to distinguish the two different versions. I also noticed that oracle has stddev_sampl

Re: [SQL] Table and/or Database Creation Time

2004-07-29 Thread Kemin Zhou
Albretch wrote: Is there such thing as a table or database creation time in the SQL standard, that you could avail yourself of? I mean do databases keep this info. I think they do since they are like little OSs and many of them have internal back up features, that must use some kind of timing. Or?

Re: [SQL] C++ interface problem with libpq.so.3

2004-07-29 Thread Kemin Zhou
Tom Lane wrote: Kemin Zhou <[EMAIL PROTECTED]> writes: I have writte a simple program to access PGDB from a C++ program using the libpq++-4.0 Most of time it runs perfect. This morning, it was working fine. Then later it stopped working. The symptom is that my program went to

[SQL] C++ interface problem with libpq.so.3

2004-07-19 Thread Kemin Zhou
I have writte a simple program to access PGDB from a C++ program using the libpq++-4.0 Most of time it runs perfect. This morning, it was working fine. Then later it stopped working. The symptom is that my program went to asleep. The stack trace: #0 0xe002 in ?? () #1 0x40120808 in pqSo

Re: [SQL] Server Side C programming Environment Set up

2004-04-22 Thread Kemin Zhou
Rod Taylor wrote: On Thu, 2004-04-22 at 01:18, Peter Eisentraut wrote: Kemin Zhou wrote: IN chapter 33 Extending SQL 33.7.5 Writing Code when run pg_config --includedir-server I got /usr/local/pgsql/include/server but my machine does NOT have this directory make install-all

[SQL] rule's behavior with join interesting

2004-04-21 Thread Kemin Zhou
Here I have a very simple case table1 table1_removed anotherTable create or replace RULE rec_remove as ON DELETE TO table1 do insert into table1_remove select old.*, a.acc from old g join anotherTable a on g.acc=a.other_acc; === the parser complained ERROR: relation "*OLD*" does not exist

[SQL] Server Side C programming Environment Set up

2004-04-21 Thread Kemin Zhou
I read a lot of document and did some search and looked at the source code of postgres but did not find a simple solution to my question. How to set up the programming environment for C. IN chapter 33 Extending SQL 33.7.5 Writing Code when run pg_config --includedir-server I got /usr/local/pgsql

[SQL] begin update ... syntax error

2004-04-10 Thread Kemin Zhou
I was trying to speed up a simple update query fri=# begin fri-# update tabA set nobegin=tmp.nobegin, noend=tmp.noend fri-# from tmp fri-# where tabA.acc=tmp.acc; ERROR: syntax error at or near "update" at character 7 The same query can be run with no problem if not starting with BEGIN. Does mea

[SQL] autocommit

2004-03-26 Thread Kemin Zhou
This might be a wish list or add feature. Could we add one simple switch to psql (the client front end or the library) --noautocommit? This will require you to type commit at the end of a query. Most of the time I would be using psql to do simple stuff. Some times I need to update databases.

[SQL] how to turn off autocommit in psql

2004-03-25 Thread Kemin Zhou
I search far and wide and found a lot of disscussions about the autocommit, but none about how to do it. After reading 50 pages, my brain is numb. Could any one give me a simple help? Thanks Kemin ** Proprietary or confiden

[SQL] cannot delete bug

2002-09-17 Thread Kemin Zhou
Dear Friends, I am not sure this due to my hardware problem or due to a bug in the postgres 7.2. kzdb=# select id from mytable where id=7224; id -- 7224 (1 row) kzdb=# delete from mytable where id=7224; ERROR: Relation 41073353 does not exist kzdb=# My simple solution is to dump the ta

[SQL] trigger viewing

2002-08-29 Thread Kemin Zhou
Dear Friends, Some times when we create foreign keys we find these type of things after \d table Triggers: RI_ConstraintTrigger_39656710, RI_ConstraintTrigger_39656716 These trigger could be this table using foreigin keys from other table or vis versa. I don't know how to figure out wh