Re: [GENERAL] Lock table, Select for update and Serialization error

2007-05-21 Thread Albe Laurenz
> As per postgres docs, 'Select for update' is used to obtain row level > locks where as 'lock table' is used to obtain table level locks. > > Under serializable isolation level, select for update gives error if > rows selected have been modified concurrently. > but 'lock table' does not give su

Re: [GENERAL] What is "Postgresql Hot"?

2007-05-21 Thread Dave Page
Ericson Smith wrote: > I guess I was confused by this page during my initial google search: > http://pgfoundry.org/projects/pghotbackup/ > > There is a PgFoundry project for Postgresql Hot Backup, and the > initial google search pointed to various hot backup projects. In the > above URL there is a

[GENERAL] initializing the database cluster

2007-05-21 Thread Islam Hegazy
Hi all I installed the source of PostgreSQL 8.2.3 on a linux machine. The installation process ended successfully but when I try to create the database cluster using the initdb command I get the following error: " creating conversions ... sh: line 1: 1838 Segmentation fault (core dumped)

Re: [GENERAL] What is "Postgresql Hot"?

2007-05-21 Thread Ericson Smith
I guess I was confused by this page during my initial google search: http://pgfoundry.org/projects/pghotbackup/ There is a PgFoundry project for Postgresql Hot Backup, and the initial google search pointed to various hot backup projects. In the above URL there is a perl script relating to hot bac

Re: [GENERAL] What is "Postgresql Hot"?

2007-05-21 Thread Dave Page
Ericson Smith wrote: > I've not been following up on the list for some time now, and recently > re-subscribed. There is some talk of "Postgresql Hot" which appears to > be a hot backup solution that may be included in 8.3 What makes you think it's a hot backup utility? HOT is a technique for minim

Re: [Re] Re: [GENERAL] Winsock error 10035 while trying to upgrade from 8.0 to 8.2

2007-05-21 Thread Magnus Hagander
Cyril VELTER wrote: > No I'm not. It's not even complied in the server nor in the pg_dump > binary. > > The server is built on windows using MSYS simply with ./configure && > make all > && make install > > > I've been able to reproduce the problem 6 times (at random po

Re: [GENERAL] Schema sanity check

2007-05-21 Thread PFC
The other option is to have a column on the mailbox table to flag that it is a default_mailbox -- but then I'd have to ensure there's only one column for each "person" flagged that way. - is_default BOOL column in mailbox table - conditional index : UNIQUE INDEX ON mailboxes( owner ) WHERE is

[GENERAL] Schema sanity check

2007-05-21 Thread Bill Moseley
I have an email client application where a person can have many mailboxes. Thus, I have "person" and "mailbox" tables: create table person ( id SERIAL PRIMARY KEY, nametext ); create table mailbox ( id SERIAL PRIMARY KEY, nametext,

Re: [GENERAL] Perl + Determine active connections on Pg 8.0.x and Pg 8.2.x

2007-05-21 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > CAJ CAJ wrote: >> SELECT count(*) from pg_stat_activity; >> >> The above query always returns 0 rows for Pg 8.0.x and 1 row for Pg 8.2.x. > The pg_stat_activity view is never completely up-to-date, there is > always some time lag. It *is* up-to-date

Re: [GENERAL] What is "Postgresql Hot"?

2007-05-21 Thread Chris Browne
[EMAIL PROTECTED] ("Ericson Smith") writes: > I've not been following up on the list for some time now, and recently > re-subscribed. There is some talk of "Postgresql Hot" which appears to > be a hot backup solution that may be included in 8.3 > > * How is it different from the current Perl script

[GENERAL] What is "Postgresql Hot"?

2007-05-21 Thread Ericson Smith
I've not been following up on the list for some time now, and recently re-subscribed. There is some talk of "Postgresql Hot" which appears to be a hot backup solution that may be included in 8.3 * How is it different from the current Perl script out there? * Can't pg_dump already give us hot back

Re: [GENERAL] doverlaps() returns null

2007-05-21 Thread Rodrigo De León
On May 21, 4:49 am, "Andrus" <[EMAIL PROTECTED]> wrote: > I'm using this for emplyment, vacation, illness etc. period calculation. > OVERLAPS produces invalid result in this case for DATE as discussed in other > thread. > > select doverlaps(date '2007-01-01',date '2007-01-02',date '2007-01-02',date

[GENERAL] feature suggestions

2007-05-21 Thread PFC
Which list is the most appropriate for proposing features and ideas for postgres ? ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

[GENERAL] Lock table, Select for update and Serialization error

2007-05-21 Thread sudhir
Hi, As per postgres docs, 'Select for update' is used to obtain row level locks where as 'lock table' is used to obtain table level locks. Under serializable isolation level, select for update gives error if rows selected have been modified concurrently. but 'lock table' does not give such er

Re: [GENERAL] Perl + Determine active connections on Pg 8.0.x and Pg 8.2.x

2007-05-21 Thread CAJ CAJ
> We have Pg 8.0.x and Pg 8.2.x on 2 separate Linux servers. We have a perl > script (perl 5.8.7, DBI-1.48/DBD::Pg-1.49) that connects to each > database to > determine if there are active connections.with the following query. > SELECT count(*) from pg_stat_activity; > > The above query always ret

Re: [GENERAL] Perl + Determine active connections on Pg 8.0.x and Pg 8.2.x

2007-05-21 Thread Richard Huxton
CAJ CAJ wrote: Hello, We have Pg 8.0.x and Pg 8.2.x on 2 separate Linux servers. We have a perl script (perl 5.8.7, DBI-1.48/DBD::Pg-1.49) that connects to each database to determine if there are active connections.with the following query. SELECT count(*) from pg_stat_activity; The above que

[GENERAL] Perl + Determine active connections on Pg 8.0.x and Pg 8.2.x

2007-05-21 Thread CAJ CAJ
Hello, We have Pg 8.0.x and Pg 8.2.x on 2 separate Linux servers. We have a perl script (perl 5.8.7, DBI-1.48/DBD::Pg-1.49) that connects to each database to determine if there are active connections.with the following query. SELECT count(*) from pg_stat_activity; The above query always returns

[GENERAL] Postgresql 8.2.4 crash with tsearch2

2007-05-21 Thread Philippe Amelant
hi, I have compiled postgresql 8.2.4 on a debian etch witch french snowball stemmer . I applied the lastest patch send by Teodor Sigaev (http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/tsearch_snowball_82-20070504.gz) and my backend still crash. I tested on 2 differents server both with etc

Re: [GENERAL] Trigger function which inserts into table; values from lookup

2007-05-21 Thread novnov
Yes, I think that would work and mabye I'll use that approach. But is there no way to implement as I orginally intended? Also, am I right in thinking that this approach is more efficient than a looping operation? William Leite Araújo wrote: > > Maybe you can use a "LEFT OUTER JOIN" ... >

Re: [GENERAL] [HACKERS] Role members

2007-05-21 Thread David Fetter
On Mon, May 21, 2007 at 02:21:52PM +0400, Akmal Akmalhojaev wrote: > Hello! I have the following question. Moving to -general. > For example I have a role ID1 with members ID2 and ID3. > Role ID2 has also members ID4 and ID5. It means that roles ID4 and ID5 are > members of ID1. > The question: I

Re: [GENERAL] Trigger function which inserts into table; values from lookup

2007-05-21 Thread William Leite Araújo
Maybe you can use a "LEFT OUTER JOIN" ... CREATE or REPLACE FUNCTION "public"."tproc_handle_item_active"() RETURNS "pg_catalog"."trigger" AS $BODY$ DECLARE rec_item record; int_org_id integer; BEGIN -- whenever an item is set active; create entries in the following table:

Re: [GENERAL] replace function in a query

2007-05-21 Thread Albe Laurenz
> I have to write a query that does the following. > > select column_x from tbl_xyz > where column_y = 'abc def ghi' > > new line characters i.e. '\n' in column_y should be replaced > with a space character i.e. ' ' in this query. > Is there any replace function that when used in the query > wi

Re: [GENERAL] Trigger function which inserts into table; values from lookup

2007-05-21 Thread novnov
No and update would not be needed; but the capability would be close enough, I'd just skip the update, do nothing for that record. But from the sound of it, the example you're suggesting involves a loop or something of that order. I could have written this using a loop but thought a bulk operatio

Re: [GENERAL] Trigger function which inserts into table; values from lookup

2007-05-21 Thread Raymond O'Donnell
On 21/05/2007 05:26, novnov wrote: OK, but, how do I set this up to do what I need? I want an insert that would create a dupe key to be rolled back, and inserts that would not create dupe keys to be committed. Do you specifically need it in a trigger? I seem to recall an example in the docs

Re: [GENERAL] replace function in a query

2007-05-21 Thread William Leite Araújo
http://www.postgresql.org/docs/8.0/interactive/functions-string.html http://www.postgresql.org/docs/8.1/interactive/functions-string.html http://www.postgresql.org/docs/8.2/interactive/functions-string.html 2007/5/21, Harpreet Dhaliwal <[EMAIL PROTECTED]>: Hi, I have to write a quer

[GENERAL] replace function in a query

2007-05-21 Thread Harpreet Dhaliwal
Hi, I have to write a query that does the following. select column_x from tbl_xyz where column_y = 'abc def ghi' new line characters i.e. '\n' in column_y should be replaced with a space character i.e. ' ' in this query. Is there any replace function that when used in the query with colulmn_y w

Re: [GENERAL] TSearch2 memory usage

2007-05-21 Thread Hannes Dorbath
On 21.05.2007 11:42, Oleg Bartunov wrote: dictionary is just a program ! Are you usin custom dictionaries ? Depends on what you mean, it's a standard ispell dict, defined as: DictFile="/foo/bar/german_utf8.dict",AffFile="/foo/bar/german_utf8.aff" You can grab both files here: http://falcon.im

Re: [GENERAL] TSearch2 memory usage

2007-05-21 Thread Oleg Bartunov
On Mon, 21 May 2007, Hannes Dorbath wrote: We have a fixed amount of 16 PG backend processes. Once created they stay forever. OLTP load is distributed over them in a SQF fashion. As loading a TSearch dictionary takes a few moments, we have a script that connects to each backend on start up an

[GENERAL] TSearch2 memory usage

2007-05-21 Thread Hannes Dorbath
We have a fixed amount of 16 PG backend processes. Once created they stay forever. OLTP load is distributed over them in a SQF fashion. As loading a TSearch dictionary takes a few moments, we have a script that connects to each backend on start up and pushes the dictionary into ram by simply c

Re: [GENERAL] Large Database Restore

2007-05-21 Thread Richard Huxton
Lee Keel wrote: So then the best way to do this kind of backup\restore is to use pg_dump? Is there any plan in the future to be able to do some sort of file-level backup like SqlServer? Oh you *can* do a file-level backup, but only of the entire cluster. If you have information shared between

Re: [GENERAL] How to implement GOMONTH function

2007-05-21 Thread Alban Hertroys
Andrus wrote: > Thank all very much for great suggestions. > > I created function > > CREATE OR REPLACE FUNCTION PUBLIC.GOMONTH(DATE, INTEGER, OUT DATE) > IMMUTABLE > AS > $_$ > SELECT ($1 + ($2 * '1 MONTH'::INTERVAL))::DATE; > $_$ LANGUAGE SQL; > > I got errors: > > function gomonth(date, nume

Re: [GENERAL] doverlaps() returns null

2007-05-21 Thread Rodrigo De León
On May 20, 1:39 pm, "Andrus" <[EMAIL PROTECTED]> wrote: > I need to check when two date intervals overlap. > Some date interval values may be null. > > I created the following function but > > select doverlaps( null, null, null, null); > > returns null. > > How to fix this so that null values are a