[GENERAL] Does PostgreSQL support EXISTS?

2001-06-12 Thread Raymond Chui
The Subject says its all. --Raymond begin:vcard n:Chui;Raymond tel;fax:(301)713-0963 tel;work:(301)713-0624 Ext. 168 x-mozilla-html:TRUE url:http://members.xoom.com/rchui/ org:NWS, NOAA version:2.1 email;internet:[EMAIL PROTECTED] title:SA, DBA note:ICQ #: 16722494

[GENERAL] Thread or not threads?

2001-05-07 Thread Raymond Chui
I have 4 columns in a table, id, sub_id, timestamp and value. The primary key is id, sub_id and timestamp combine. I need to insert many rows (may be 10 thousands every 4 minutes) as fast as I can to the same host, same port, same database, same table. A. Open only one JDBC (Java Database

[GENERAL] Re: Does PostgreSQL support Constant Expression (Alias Name)?

2001-03-05 Thread Raymond Chui
Thank you very much to all helped me. You save me a lot of time. (*^_^*) begin:vcard n:Chui;Raymond tel;fax:(301)713-0963 tel;work:(301)713-0624 Ext. 168 x-mozilla-html:TRUE url:http://members.xoom.com/rchui/ org:NWS, NOAA version:2.1 email;internet:[EMAIL PROTECTED] title:SA, DBA note:ICQ #:

Re: [GENERAL] store procedure in pl/pgsql

2001-03-02 Thread Raymond Chui
Juan Ramn Cortabitarte wrote: Hello, I'm trying to do some store procedure in pl/pgsql but the sql server says me: Error: ERROR: Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'. Recognized languages are sql, C, internal and the created procedural languages. Im using

[GENERAL] PL/PGSQL Programming Guide/Reference Guide Want

2001-02-23 Thread Raymond Chui
Please tell me where and how I get the PL/PGSQL Programming Guide and Reference Guide? Because the online documentation pages are not enough examples. Thank you very much! -- Why we want to teach our babies to talk and walk, then later we tell them "sit down!", "be quiet!" ? Democracy is not a

[GENERAL] Row ID and auto-increment?

2001-02-16 Thread Raymond Chui
If I create a table like create table tablename ( aNuminteger not null, namevarchar(10) ); If I do select * from tablename; q1. Is there such thing rowid similar to Oracle in PostgreSQL? q2. How do I make aNum auto increment by 1? Need to write a trigger? how to write that? I want to

[GENERAL] Re: How to make PostgreSQL JDBC drive get PGTZ?

2001-02-14 Thread Raymond Chui
I solved this problem by execute a SQL statement below after JDBC connection. SET TIME ZONE 'GMT'; --Raymond begin:vcard n:Chui;Raymond tel;fax:(301)713-0963 tel;work:(301)713-0624 Ext. 168 x-mozilla-html:TRUE url:http://members.xoom.com/rchui/ org:NWS, NOAA version:2.1

[GENERAL] Re: Unrecognized language plpgsql when CREATE FUNCTION?!

2001-02-05 Thread Raymond Chui
Be default PL/PGSQL is not installed in each database. You must type createlang --host=hostname --port=5432 --username=postgres --dbname=yourdb --pglib=$PGLIB plpgsql yourdb To verify type createlang -l yourdb --Raymond begin:vcard n:Chui;Raymond tel;fax:(301)713-0963 tel;home:ICQ #:

[GENERAL] ON DELETE CASCADE and TRIGGER

2001-02-05 Thread Raymond Chui
I have three tables: CREATE TABLE table1 ( idchar(8) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE table2 ( idchar(8) NOT NULL, PRIMARY KEY (id), FOREIGN KEY (id) REFERENCES table1 (id) ON DELETE CASCADE ); CREATE TABLE table3 ( idchar(8) NOT NULL, codechar(2) NOT NULL,

[GENERAL] Why pg_dump doesn't dump the foriegn keys?

2001-02-05 Thread Raymond Chui
I do pg_dump -u -s dbname db_schema I look at that db_schema file, I only see the primary keys but no foreign keys. I don't understand what is OID use for. Will -o option dump the foreign keys for me? Thank you! -- Why we want to teach our babies to talk and walk, then later we tell them "sit

[GENERAL] TODAY and CURRENT?

2000-12-19 Thread Raymond Chui
I have a table with columns datetime timestamp, valuefloat(8) I want to delete rows 10 days older or 10 hours older by delete from tablename where datetime TODAY-10; or delete from tablename where datetime between CURRENT-10 and CURRENT; So are there key words TODAY, CURRENT in

[GENERAL] How to import/export data from/to an ASCII file?

2000-12-13 Thread Raymond Chui
For example create table testTable ( id integer, name char(20) ); an ASCII file format with field separator "|" is 1|Hello| 2|Again| .. There is a way to do this in Oracle, Sybase, Informix and MySQL. But I want to know how to do this in PostgreSQL. Please don't tell me use pg_dump,