Re: [GENERAL] call initdb as regular user

2011-08-18 Thread John Cheng
Sure you can. The initdb command just sets up the directory you specified and that's all it does. The files in the directory will be created with that user's permission. So the directory you specify must be accessible to that regular user. man page - http://linux.die.net/man/1/initdb Creating a

Re: [GENERAL] call initdb as regular user

2011-08-18 Thread John Cheng
On Thu, Aug 18, 2011 at 11:59 AM, alexondi alexo...@rambler.ru wrote: I have some single-purpose system and user can interact only with special software (on computer would start only this software{daemon and gui}, postgresql and  other system daemons). And I don't wont change user when I call

Re: [GENERAL] Postgres 8.0 upgrade to 9.0

2011-08-01 Thread John Cheng
I am planning on bringing our 8.3 installation up to 9.0.4. First I upgraded the jdbc driver on our staging environment, after 1 month on staging, we tested with the 9.0 driver on production. The actual database upgrade will be more complicated, and we are going to simulate an upgrade on a

Re: [GENERAL] Cannot reproduce why a query is slow

2011-07-27 Thread John Cheng
Sorry about the long wait between reply. On Sat, May 7, 2011 at 2:36 PM, Tomas Vondra t...@fuzzy.cz wrote: Resource usually means there's too much I/O so the query is slow, but when you try it later the drives are idle and query runs much faster. Run some monitoring, e.g. even a simple

[GENERAL] Cannot reproduce why a query is slow

2011-05-05 Thread John Cheng
Hi, We have certain types of query that seems to take about 900ms to run according to postgres logs. When I try to run the same query via command line with EXPLAIN ANALYZE, the query finishes very quickly. What should I do to try to learn more about why it is running slowly? The query is a bit

Re: [GENERAL] permission denied for schema even as superuser.

2011-05-05 Thread John Cheng
Could it be triggering a function that is defined with SECURITY DEFINER and the definer of the function does not have the right permissions? On Thu, May 5, 2011 at 4:03 AM, Chris Young ch...@chris.net.au wrote: Greetings, I'm trying to perform the following query, but receive a perplexing

Re: [GENERAL] Cannot reproduce why a query is slow

2011-05-05 Thread John Cheng
On Thu, May 5, 2011 at 8:54 AM, Andrew Sullivan a...@crankycanuck.ca wrote: On Thu, May 05, 2011 at 08:02:46AM -0700, John Cheng wrote: We have certain types of query that seems to take about 900ms to run according to postgres logs. When I try to run the same query via command line

Re: [GENERAL] Cannot reproduce why a query is slow

2011-05-05 Thread John Cheng
On Thu, May 5, 2011 at 10:01 AM, Andrew Sullivan a...@crankycanuck.ca wrote: On Thu, May 05, 2011 at 09:27:47AM -0700, John Cheng wrote: I have a couple of queries that allow me to see the active locks in the database. It might help me see if these queries are blocked by other locking queries

[GENERAL] earthdistance or PostGIS for find * within point and radius

2010-10-28 Thread John Cheng
I have a database with the earthdistance contrib module installed and I need to find records whose long latitude are within a given distance of a zip code. From the documentation on earthdistance, I believe it is certainly possible to do a find points within a distance of another point using the 

[GENERAL] Binary Replication and Slony

2010-09-20 Thread John Cheng
Congrats on the 9.0 release of PostgreSQL. One of the features I am really interested in is the built-in binary replication. Our production environment has been using PostgreSQL for more than 5 years (since this project started). We have been using Slony-I as our replication mechanism. I am

Re: [GENERAL] Binary Replication and Slony

2010-09-20 Thread John Cheng
Much thanks to everyone! The mailing list, as usual, has been extremely helpful. On Mon, Sep 20, 2010 at 10:33 AM, Brad Nicholson bnich...@ca.afilias.infowrote: On 10-09-20 12:49 PM, Bruce Momjian wrote: John Cheng wrote: Congrats on the 9.0 release of PostgreSQL. One of the features I am

[GENERAL] Just saw a blog on Amazon Relational Database Service (Beta)

2009-10-27 Thread John Cheng
I saw http://aws.amazon.com/rds/?ref_=pe_12300_13473310 on reddit today. Faqs http://aws.amazon.com/rds/faqs/#14 here. There's been talks of PostgreSQL in Amazon's EC I know some of the EnterpriseDB people were looking at it. So maybe the people here would be interested in seeing how Amazon

[GENERAL] Blog post about Amazon Elastic Block Storage

2009-07-29 Thread John Cheng
I know quite a number of people here, like myself, are intrigued by the prospect of running PostgreSQL on Amazon's EC. I thought this blog post on the performance of EBS was interesting, so I figure I'd share it with everybody. http://orion.heroku.com/past/2009/7/29/io_performance_on_ebs/

Re: [GENERAL] Problem search on text arrays, using the overlaps () operator

2009-07-22 Thread John Cheng
- nha lyondi...@free.fr wrote: Another way could concern the hash join. It has been shown that this step costs a lot with respect to the overall runtime. Depending on available storage space and DBMS load, a kind of materialized view may be handled in order to cut off the overloading

Re: [GENERAL] Problem search on text arrays, using the overlaps () operator

2009-07-08 Thread John Cheng
Accidentally sent to nha only --- On Wed, 7/8/09, John Cheng jlch...@ymail.com wrote: From: John Cheng jlch...@ymail.com Subject: Re: [GENERAL] Problem search on text arrays, using the overlaps () operator To: nha lyondi...@free.fr Date: Wednesday, July 8, 2009, 4:24 PM Hi nha, I

Re: [GENERAL] Problem search on text arrays, using the overlaps () operator

2009-07-07 Thread John Cheng
I don't mean to be pesky. I was just wondering if there is anything else I should try? Should I simply rewrite all queries, change the form WHERE textarr '{foo, bar}'::text[] To WHERE (textarr '{foo}'::text[] OR textarr '{bar}'::text[]) ? -- Sent via pgsql-general mailing

Re: [GENERAL] Problem search on text arrays, using the overlaps () operator

2009-07-06 Thread John Cheng
- nha lyondi...@free.fr wrote: From: nha lyondi...@free.fr To: John Cheng jlch...@ymail.com Cc: pgsql-general@postgresql.org Sent: Monday, July 6, 2009 9:12:22 AM GMT -08:00 US/Canada Pacific Subject: Re: [GENERAL] Problem search on text arrays, using the overlaps () operator Hello

Re: [GENERAL] Problem search on text arrays, using the overlaps () operator

2009-07-03 Thread John Cheng
queries on tsvector columns, but I have not tested myself. - Original Message - From: Andreas Wenk a.w...@netzmeister-st-pauli.de To: John Cheng jlch...@ymail.com, PG-General Mailing List pgsql-general@postgresql.org Sent: Friday, July 3, 2009 2:12:46 AM GMT -08:00 US/Canada Pacific Subject

[GENERAL] Problem search on text arrays, using the overlaps () operator

2009-07-01 Thread John Cheng
We use text[] on one of our tables. This text[] column allows us to search for records that matches a keyword in a set of keywords. For example, if we want to find records that has a keyword of foo or bar, we can use the condition: keywords '{foo, bar}'::text[] Another wau is to do this:

Re: [GENERAL] ubuntu 9.04 and auto-start

2009-06-02 Thread John Cheng
The same way you add any other service in Ubuntu :) To add a service, use update-rc.d servicename defaults In your case, it sounds like your servicename is postgresql, so you'd have update-rc.d postgresql defaults Try this URL:

Re: [GENERAL] What may cause - Connection rejected: FATAL: Ident authentication failed for user?

2009-04-22 Thread John Cheng
Check your pg_hba.conf file. What does it look like? The message suggests that your job is trying to connect to the database as the user schema_owner_name (or whatever the real user name is), but is actually running as a different unix user. Also, did anyone change the unix user running this

Re: [GENERAL] nooby Q: temp tables good for web apps?

2009-04-07 Thread John Cheng
Hi Kenneth, One concern I have with SSD drives is that the performance degrades over time. If you were not familiar with this issue already, take a look at the following article. http://www.anandtech.com/storage/showdoc.aspx?i=3531 It is not a huge problem and I have faith in Intel to come

Re: [GENERAL] Posgres Adding braces at beginning and end of text (html) content

2009-04-02 Thread John Cheng
PostgreSQL does not add braces to text. It sounds like a problem with the code you have that inserts and retreives data out of PostgreSQL Let's try a test case: BEGIN; CREATE TEMP TABLE test_table ( foo text ); INSERT INTO test_table (foo) VALUES('htmlfoo/html'); SELECT foo FROM

Re: [GENERAL] Postgresql On Windows

2009-03-27 Thread John Cheng
From my experience, you must use the forward slash. Using the backslash may give you an error: \i C:\sql\test.sql C:: Permission denied Instead, use \i C:/sql/test.sql From: Raymond O'Donnell r...@iol.ie To: MDB mdb...@yahoo.com Cc:

Re: [GENERAL] Is there a meaningful benchmark?

2009-03-19 Thread John Cheng
Comparison between MySQL using the MyISAM engine with PostgreSQL is really not sensible. For one, the MyISAM engine does not have transaction and foreign key support, while PostgreSQL supports transaction and foreign key. Would anyone really give up transaction and integrity for slightly more

Re: [GENERAL] Is there a meaningful benchmark?

2009-03-19 Thread John Cheng
On Thu, Mar 19, 2009 at 3:23 PM, Scott Marlowe scott.marl...@gmail.comwrote: On Thu, Mar 19, 2009 at 3:26 PM, John Cheng chonger.ch...@gmail.com wrote: Comparison between MySQL using the MyISAM engine with PostgreSQL is really not sensible. For one, the MyISAM engine does not have

Re: [GENERAL] PostgreSQL versus MySQL for GPS Data

2009-03-17 Thread John Cheng
This is question for Juan, have you asked the MySQL mailing list? What do they say about this? On Tue, Mar 17, 2009 at 9:05 AM, Erik Jones ejo...@engineyard.com wrote: On Mar 17, 2009, at 4:47 AM, Craig Ringer wrote: The question is: Which DBMS do you think is the best for this kind of

[GENERAL] What to do after an ERROR: out of memory

2008-07-29 Thread John Cheng
We were updating a large set of data (executing a stored procedure against a large set of data in one statement/transaction) while autovacuum was running. The resulting message looked like: 2008-07-28 21:18:08 CDT CONTEXT: automatic vacuum of table databasename._lms.sl_log_2 TopMemoryContext:

Re: [GENERAL] How do I set up automatic backups?

2008-07-29 Thread John Cheng
Slony-I replication is also a viable choice for backups. On Tue, Jul 29, 2008 at 1:34 PM, Richard Broersma [EMAIL PROTECTED] wrote: On Tue, Jul 29, 2008 at 1:28 PM, Christophe [EMAIL PROTECTED] wrote: I was asked how to automate the procedure, and I couldn't answer.

[GENERAL] System in Recovery Mode But No Activity

2008-06-20 Thread John Cheng
We had a run away process on our database box that used up all the physical and all the virtual memory (swap). This caused the RedHat Linux oom-killer to kill many processes, including some Postgres ones. Postgres went into a funky state after that time: 2008-06-20 14:19:10 CDT [unknown] LOG:

Re: [GENERAL] System in Recovery Mode But No Activity

2008-06-20 Thread John Cheng
. Then postgres was able to stop normally. After that, I restarted postgresql normally and it went into recovery mode for about 30 seconds. After that, it started to behave normally again. On Fri, Jun 20, 2008 at 9:34 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Fri, Jun 20, 2008 at 7:12 PM, John Cheng