Re: [GENERAL] Problem with autovacuum and pg_autovacuum

2007-07-06 Thread Pavan Deolasee
On 7/5/07, Andreas 'ads' Scherbaum [EMAIL PROTECTED] wrote: Hello, On Wed, 4 Jul 2007 18:04:35 -0400 Alvaro Herrera wrote: Most likely it is worried about XID wraparound, and those are precisely the tables that need urgent vacuumed because they haven't been vacuumed in a long time. No,

Re: [GENERAL] tsearch2 in multilingual database?

2007-07-06 Thread Hannes Dorbath
On 04.07.2007 11:20, Joshua N Pritikin wrote: Sometime in the future, I anticipate storing other languages in addition to English in my database to be indexed with tsearch2. set_curcfg() seems to be per-session. Will I need to call set_curcfg() every time I switch languages? You *should*

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread PFC
I am doing a project using Ruby On Rails with PostgreSQL as the database. I have not seen the term polymorphic used with databases except with Rails so I will quickly describe it. Instead of holding just an id as a foreign key, the record holds a type field which is a string and an id. The

Re: [GENERAL] Problem with autovacuum and pg_autovacuum

2007-07-06 Thread Andreas 'ads' Scherbaum
On Wed, 4 Jul 2007 19:47:12 -0400 Alvaro Herrera wrote: Andreas 'ads' Scherbaum wrote: Oh. It's not the age. Please let us look at the pg_stat_user_tables entries for the involved tables? If it's picking the same tables maybe pgstats has stale info, but why is it not updating it? Hmm,

[GENERAL] DB crashed and duplicated template0 db

2007-07-06 Thread Luki Rustianto
Hi, One of my customer's server goes down, I don't know yet how, but when when they restart the machine I got this: 1. DB is working like usual 2. template0 and template1 database is *duplicated* 3. I can't do pg_dump, because error returned (see below) How can I backup the database (other than

Re: [GENERAL] Nested Transactions in PL/pgSQL

2007-07-06 Thread Nykolyn, Andrew
My real issue is not that I need subtransactions but I need to flush the buffer so that I can regain memory for my stored procedure to complete without getting a memory error. -Original Message- From: Alvaro Herrera [mailto:[EMAIL PROTECTED] Sent: Thursday, July 05, 2007 8:06 PM To: John

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Perry Smith
On Jul 6, 2007, at 2:31 AM, PFC wrote: I am doing a project using Ruby On Rails with PostgreSQL as the database. I have not seen the term polymorphic used with databases except with Rails so I will quickly describe it. Instead of holding just an id as a foreign key, the record holds a type

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread David Fetter
On Thu, Jul 05, 2007 at 09:56:12PM -0500, Perry Smith wrote: I am doing a project using Ruby On Rails with PostgreSQL as the database. I have not seen the term polymorphic used with databases except with Rails so I will quickly describe it. You have now :)

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread PFC
O Here is how I implemented something very similar (in PHP) : - Node class and several derived classes. - nodes table which contains the fields for the base class with node_id as a PK and a field which indicates the class - nodes_*** tables which contain the extra fields for

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Perry Smith
On Jul 6, 2007, at 8:01 AM, David Fetter wrote: On Thu, Jul 05, 2007 at 09:56:12PM -0500, Perry Smith wrote: I am doing a project using Ruby On Rails with PostgreSQL as the database. I have not seen the term polymorphic used with databases except with Rails so I will quickly describe it.

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Perry Smith
On Jul 6, 2007, at 8:23 AM, PFC wrote: The advantage of my approach is that : [ snip -- all very good stuff ] I think I can make something like this into Rails fairly easy. Hm, another reason why I don't really like the Rails approach... do they at least use unique IDs ? Please

Re: [GENERAL] Nested Transactions in PL/pgSQL

2007-07-06 Thread Alvaro Herrera
Nykolyn, Andrew wrote: My real issue is not that I need subtransactions but I need to flush the buffer so that I can regain memory for my stored procedure to complete without getting a memory error. Please don't top-post. Normal operation does not fill buffers, thus they don't need any

[GENERAL] REVOKE ALL FROM ALL

2007-07-06 Thread Knut P. Lehre
Is the following a safe way to revoke all rights from all users and groups on a table or view (TABLEORVIEWNAME)?update pg_class set relacl=null where relname='TABLEORVIEWNAME';

Re: [GENERAL] DB crashed and duplicated template0 db

2007-07-06 Thread Sibte Abbas
On 7/6/07, Luki Rustianto [EMAIL PROTECTED] wrote: Hi, One of my customer's server goes down, I don't know yet how, but when when they restart the machine I got this: 1. DB is working like usual 2. template0 and template1 database is *duplicated* 3. I can't do pg_dump, because error returned

[GENERAL] CASE in ORDER BY clause

2007-07-06 Thread Louis-David Mitterrand
Hi, I am trying the following: critik=# select start_date from show_date order by case when start_date CURRENT_DATE then start_date desc else start_date asc end; ERROR: syntax error at or near desc LINE 1: ...se when start_date CURRENT_DATE then start_date desc else

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread David Fetter
On Fri, Jul 06, 2007 at 08:39:50AM -0500, Perry Smith wrote: On Jul 6, 2007, at 8:01 AM, David Fetter wrote: On Thu, Jul 05, 2007 at 09:56:12PM -0500, Perry Smith wrote: I am doing a project using Ruby On Rails with PostgreSQL as the database. I have not seen the term polymorphic used

Re: [GENERAL] [pgsql-general] In memory tables/databases

2007-07-06 Thread Robert Treat
On Thursday 05 July 2007 13:52, Joshua D. Drake wrote: A.M. wrote: On Jul 5, 2007, at 13:20 , Andrew Sullivan wrote: On Sun, Jul 01, 2007 at 11:11:30PM +0200, Alexander Todorov wrote: The question was is there something else that exists in PostgreSQL and will do the same job. Why not

Re: [GENERAL] Localization trouble

2007-07-06 Thread Michael Glaesemann
On Jul 5, 2007, at 20:59 , Tom Lane wrote: Michael Glaesemann [EMAIL PROTECTED] writes: I think display depends on whether or not you configured Postgres with or without --enable-nls. No, to_char understands numeric locales regardless of enable-nls. There is no provision for

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Perry Smith
On Jul 6, 2007, at 10:36 AM, David Fetter wrote: At some point, you're going to realize that Rails is the problem, not the solution. It's written by people who do not understand what a shared data store is and reflects problems inherent in its native database platform: MySQL 3.23. Thats

Re: [GENERAL] CASE in ORDER BY clause

2007-07-06 Thread Viatcheslav Kalinin
Louis-David Mitterrand wrote: Hi, I am trying the following: critik=# select start_date from show_date order by case when start_date CURRENT_DATE then start_date desc else start_date asc end; ERROR: syntax error at or near desc LINE 1: ...se when start_date CURRENT_DATE

Re: [GENERAL] Problem with autovacuum and pg_autovacuum

2007-07-06 Thread Alvaro Herrera
Andreas 'ads' Scherbaum wrote: On Fri, 6 Jul 2007 11:30:19 +0530 Pavan Deolasee wrote: Hello, On 7/5/07, Andreas 'ads' Scherbaum [EMAIL PROTECTED] wrote: On Wed, 4 Jul 2007 18:04:35 -0400 Alvaro Herrera wrote: Most likely it is worried about XID wraparound, and those are

Re: [GENERAL] DB crashed and duplicated template0 db

2007-07-06 Thread Tom Lane
Luki Rustianto [EMAIL PROTECTED] writes: One of my customer's server goes down, I don't know yet how, but when when they restart the machine I got this: 1. DB is working like usual 2. template0 and template1 database is *duplicated* 3. I can't do pg_dump, because error returned (see below)

Re: [GENERAL] CASE in ORDER BY clause

2007-07-06 Thread Viatcheslav Kalinin
Louis-David Mitterrand wrote: Hi, I am trying the following: critik=# select start_date from show_date order by case when start_date CURRENT_DATE then start_date desc else start_date asc end; ERROR: syntax error at or near desc LINE 1: ...se when start_date CURRENT_DATE

Re: [GENERAL] Problem with autovacuum and pg_autovacuum

2007-07-06 Thread Andreas 'ads' Scherbaum
On Fri, 6 Jul 2007 11:30:19 +0530 Pavan Deolasee wrote: Hello, On 7/5/07, Andreas 'ads' Scherbaum [EMAIL PROTECTED] wrote: On Wed, 4 Jul 2007 18:04:35 -0400 Alvaro Herrera wrote: Most likely it is worried about XID wraparound, and those are precisely the tables that need urgent

[GENERAL] Implementation of three new operators inside the PostgreSQL

2007-07-06 Thread rupesh bajaj
Hi, I am mailing on behalf of the Database Systems Lab, Indian Institute of Science(IISc), Bangalore, India. We have implemented three new operators internal to the PostgreSQL 8.1.2 engine in order to support queries on multilingual data(english and hindi as of now). It can be extended to support

[GENERAL] ISO TESTS for a Pg lexer+parser

2007-07-06 Thread Kynn Jones
Hi! I am in the process of writing a PostgreSQL lexer/parser in Perl, because everything else I've found in this area is too buggy. I'm basing this lexer/parser on the lexer and parser encoded respectively in scan.l and gram.y under src/backend/parser. I'm looking for a solid collection of

[GENERAL] Capturing return value of a function in Pl/Perl

2007-07-06 Thread Harpreet Dhaliwal
Hi, I'm calling a plpgsql function in a plperl function. plpgsql function is a simple select query returning a single row of records. How can i retrieve the values of different fields in my plperl function? If i write something like my $query = SELECT sp_select; my $exec =

Re: [GENERAL] ISO TESTS for a Pg lexer+parser

2007-07-06 Thread Stephen Frost
* Kynn Jones ([EMAIL PROTECTED]) wrote: Hi! I am in the process of writing a PostgreSQL lexer/parser in Perl, because everything else I've found in this area is too buggy. I'm basing this lexer/parser on the lexer and parser encoded respectively in scan.l and gram.y under src/backend/parser.

[GENERAL] Update a single row without firing its triggers?

2007-07-06 Thread Dmitry Koterov
Hello. Suppose I have a table tbl with columns (a, b, c, counter). And I have 5 ON UPDATE triggers assigned to this table. They process (a, b, c) columns, but never depend on counter. I need to update counter field, but I know that it is totally independent, so - for performance reason I want

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Alexander Staubo
On 7/6/07, David Fetter [EMAIL PROTECTED] wrote: At some point, you're going to realize that Rails is the problem, not the solution. It's written by people who do not understand what a shared data store is and reflects problems inherent in its native database platform: MySQL 3.23. This is

Re: [GENERAL] ISO TESTS for a Pg lexer+parser

2007-07-06 Thread Dann Corbit
This stuff: /postgresql-8.2.4/src/test/regress/sql Should do for starters. -Original Message- From: [EMAIL PROTECTED] [mailto:pgsql-general- [EMAIL PROTECTED] On Behalf Of Kynn Jones Sent: Friday, July 06, 2007 12:15 PM To: pgsql-general@postgresql.org Subject: [GENERAL] ISO TESTS

Re: [GENERAL] Problem with autovacuum and pg_autovacuum

2007-07-06 Thread Andreas 'ads' Scherbaum
On Fri, 6 Jul 2007 12:06:41 -0400 Alvaro Herrera wrote: Andreas 'ads' Scherbaum wrote: On Fri, 6 Jul 2007 11:30:19 +0530 Pavan Deolasee wrote: On 7/5/07, Andreas 'ads' Scherbaum [EMAIL PROTECTED] wrote: On Wed, 4 Jul 2007 18:04:35 -0400 Alvaro Herrera wrote: Most likely

Re: [GENERAL] ISO TESTS for a Pg lexer+parser

2007-07-06 Thread Bruce Momjian
Stephen Frost wrote: -- Start of PGP signed section. * Kynn Jones ([EMAIL PROTECTED]) wrote: Hi! I am in the process of writing a PostgreSQL lexer/parser in Perl, because everything else I've found in this area is too buggy. I'm basing this lexer/parser on the lexer and parser encoded

Re: [GENERAL] autovacumm not working ?

2007-07-06 Thread Tomasz Rakowski
Mathew, For frequently updated tables I set vac_scale_factor to 0.01. I also changed cost_delay from 150 to 10 Now it seems to work much better. Autovacuum is executed much quicker and still doesn't influence regular operations very much (and that was my concern when it was set to 0).

Re: [GENERAL] Capturing return value of a function in Pl/Perl

2007-07-06 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I'm calling a plpgsql function in a plperl function. plpgsql function is a simple select query returning a single row of records. How can i retrieve the values of different fields in my plperl function? Please check out the page:

[GENERAL] ssl enabling of postgres on Mac OS X

2007-07-06 Thread Michael Hogarth
Hi folks. I successfully compiled/built pg 8.1.9 using --with-openssl on a Mac. I modified the startup config files to enable ssl. Server starts without problems, but when I try to require SSL from pgAdminIII, I get server does not support SSL. Has anyone been able to get an SSL-enabled PG

Re: [GENERAL] ssl enabling of postgres on Mac OS X

2007-07-06 Thread Tom Lane
Michael Hogarth [EMAIL PROTECTED] writes: Has anyone been able to get an SSL-enabled PG built and running on Mac OS X (10.2.4)? Dunno about 10.2.x, but it seems to work fine for me on 10.4.10. Can you connect with psql, and does it show a startup comment like this: SSL connection (cipher:

Re: [GENERAL] ssl enabling of postgres on Mac OS X

2007-07-06 Thread Perry Smith
On Jul 6, 2007, at 9:57 PM, Michael Hogarth wrote: Hi folks. I successfully compiled/built pg 8.1.9 using --with-openssl on a Mac. I modified the startup config files to enable ssl. Server starts without problems, but when I try to require SSL from pgAdminIII, I get server does not support