[GENERAL] Is there a better way to do this?

2007-08-28 Thread Wei Weng
Hi all I want to implement something like the following: CREATE OR REPLACE FUNCTION AddDays (TIMESTAMP WITHOUT TIME ZONE , INT) RETURNS TIMESTAMP WITHOUT TIME ZONE AS ' DECLARE time ALIAS FOR $1; days ALIAS FOR $2; BEGIN RETURN time+days*24*3600*''1

Re: [GENERAL] Anything I can do to speed up this query?

2006-12-06 Thread Wei Weng
On Tue, 2006-12-05 at 15:56 -0500, Wei Weng wrote: I have a table that has roughly 200,000 entries and many columns. The query is very simple: SELECT Field1, Field2, Field3... FieldN FROM TargetTable; TargetTable has an index that is Field1. I think I have discovered the reason

[GENERAL] Anything I can do to speed up this query?

2006-12-05 Thread Wei Weng
I have a table that has roughly 200,000 entries and many columns. The query is very simple: SELECT Field1, Field2, Field3... FieldN FROM TargetTable; TargetTable has an index that is Field1. The thing is on this machine with 1Gig Ram, the above query still takes about 20 seconds to finish. And

Re: [GENERAL] Anything I can do to speed up this query?

2006-12-05 Thread Wei Weng
Forgot to mention the version I am using. PostgreSQL 7.4.13 Thanks On Tue, 2006-12-05 at 15:56 -0500, Wei Weng wrote: I have a table that has roughly 200,000 entries and many columns. The query is very simple: SELECT Field1, Field2, Field3... FieldN FROM TargetTable; TargetTable has

Re: [GENERAL] Anything I can do to speed up this query?

2006-12-05 Thread Wei Weng
I am running this in the same machine as the database though. Thanks On Tue, 2006-12-05 at 16:02 -0500, Jan de Visser wrote: On Tuesday 05 December 2006 3:56 pm, Wei Weng wrote: I have a table that has roughly 200,000 entries and many columns. The query is very simple: SELECT Field1

[GENERAL] Question on inserting and querying at the same time.

2006-11-07 Thread Wei Weng
I have a database table that has about 90k entries, they are all straightfoward text, and there is only one ID field that I use as primary key for this table. I have two threads working on this table. One of them inserting new content constantly, (about every second) another one idles and only

[GENERAL] Question on MD5 authentication

2006-10-12 Thread Wei Weng
I am trying to connect to machine A (192.168.1.155) from a different machine B (192.168.1.180), with password transmitted as a MD5 string. I have the following lines in my pg_hba.conf file. hostall all 192.168.1.180 255.255.255.1md5 I created a database user

Re: [GENERAL] Question on MD5 authentication

2006-10-12 Thread Wei Weng
On Thu, 2006-10-12 at 15:38 -0400, Wei Weng wrote: I am trying to connect to machine A (192.168.1.155) from a different machine B (192.168.1.180), with password transmitted as a MD5 string. I have the following lines in my pg_hba.conf file. hostall all 192.168.1.180

Re: [GENERAL] Question on MD5 authentication

2006-10-12 Thread Wei Weng
On Thu, 2006-10-12 at 15:50 -0400, Tom Lane wrote: Wei Weng [EMAIL PROTECTED] writes: I have the following lines in my pg_hba.conf file. hostall all 192.168.1.180 255.255.255.1md5 Not relevant to your immediate problem, but: you almost certainly want

Re: [GENERAL] Question on MD5 authentication

2006-10-12 Thread Wei Weng
I think I have found out something suspicious. I used tcpdump to monitor the traffic to and from port 5432, and it seems that the password the client on A sends out to the postmaster on B is md54570471eccef21ae3c6e43033d8d2f66 While the MD5-ed password stored in system catalog (pg_shadow) is

[GENERAL] State of Postgresql Replication?

2006-06-09 Thread Wei Weng
Is there any OSS solutions (stable) for postgresql replication for postgresql 8.0? Sincerely, Wei Weng ---(end of broadcast)--- TIP 6: explain analyze is your friend