[SQL] Why table has drop, but the foreign key still there?

2003-08-14 Thread Raymond Chui
Here are the simple things I did create table state ( state_code char(2) not null, state varchar(15) not null, primary key (state_code) ); create table whitepage ( user_id char(8) not null, email varchar(50), telephone char(16) not null, contact_namevarchar(30) not null,

[SQL] Timestamp problem

2003-07-19 Thread Raymond Chui
7-15 13:20:00.421+00 Then I got SQLException Bad Timestamp Format at 23 in 2003-07-14 14:45:00.421+00 What is 23? How do I resolve this problem? Thank Q! -- Raymond Chui NWS at NOAA 301-713-0640 ext 168 ---(end of broadcast)--- TIP 9: the planner w

[SQL] CURRENT_TIMSTAMP

2002-12-02 Thread Raymond Chui
I created a column, dada type timstamp with time zone and with default CURRENT_TIMSTAMP it shows me the default is default ('now'::text)::timstamp(6) with time zone Then when I insert a row, the default timestamp value is -mm-dd HH:MM:ss.m+00 where m is milliseconds. How do I make d

[SQL] How to execute a system file in procedure?

2001-08-20 Thread Raymond Chui
I would like execute a system command or my program or my shell script in procedure. How do I do that? For example, CREATE FUNCTION myname() RETURN OPAQUE AS ' BEGIN IF count(NEW.aColumn) >= 600 THEN RAISE EXCEPTION ''Hello, it is time to re-index the table.''; END IF;

[SQL] Where is pgplsql.so located in 7.1.2?

2001-08-14 Thread Raymond Chui
When I do createlang -U postgres -d mydbname pgplsql mydbname I got can't find /usr/share/pgsql/plpgsql.so error message. But there is no plpgsql.so file in /usr/share/pgsql directory! I just installed RPM binary 7.1.2 for Redhat 6.2 In 7.0 the pgplsql.so file is located in /usr/lib/pgsql/ So

[SQL] The numbers are not match in 7.1.2

2001-08-14 Thread Raymond Chui
When I do select * from pg_database; I got datname | ... | datlastsysoid mydbname | ... | 18539 But When I cd $PGDATA/data/base/ ls -la I got 1 18719 18725 Where is 18539 ??!! I think mydbname is 18725 When I cd 18725 ls There are

[SQL] Mirroring the database?

2001-08-13 Thread Raymond Chui
Does the latest PostgreSQL 7.1.2 support database mirroring? I have machine A, B and C, they all have the same database and tables. Machine A is the operational machine, machine B and C are backup. If users do INSERT, UPDATE and DELETE in machine A, I want have the same SQL statements in machine

[SQL] When PostgreSQL compliant JDBC 2.0?

2001-07-20 Thread Raymond Chui
Currently the JDBC drive in PostgreSQL 7.0, 7.1 are not support batch updates. I am wonder anybody know is there other PostgreSQL JDBC drive support batch updates? Thanks! --Raymond begin:vcard n:Chui;Raymond tel;fax:(301)713-0963 tel;work:(301)713-0624 Ext. 168 x-mozilla-html:TRUE url:http:

[SQL] Why lost all foreign key constraits after cluster?

2001-07-17 Thread Raymond Chui
After I performed cluster indexname on tablename; All the foreign key constraints are lost on that table, why is that? I get messages like NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "tablename" during cluster I don't want to lost the foreign key constraints