Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-21 Thread Simon Riggs
On Mon, 2008-10-20 at 18:45 -0400, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: On Mon, 2008-10-20 at 17:44 -0300, Alvaro Herrera wrote: That's been extended with an epoch counter per the docs; I don't think that's appropriate for the new functions, is it? I assumed it was, so

Re: [GENERAL] [HACKERS] Debian no longer dumps cores?

2008-10-21 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Oct 20, 2008 at 05:49:04PM -0300, Alvaro Herrera wrote: Hi, My Debian system (now running Linux 2.6.26) is no longer dumping core files, and I can't figure out why :-( Tested now with 2.6.25-2. Coredumps still work there. I submitted it

Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-21 Thread Zeugswetter Andreas OSB sIT
* pg_last_recovered_xact_xid() Will throw an ERROR if *not* executed in recovery mode. returns bigint * pg_last_completed_xact_xid() Will throw an ERROR *if* executed in recovery mode. returns bigint Should these return xid? And shouldn't these two be folded together ? It seems

[GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Ivan Sergio Borgonovo
plainto_tsquery is handy to make a string from users turn into a tsquery. This strips control characters and glue lexemes with . Now I've several strings coming from input user and what I'd like to do is assign a different token to each part. eg. input1 = ratto matto | gatto the input2 =

[GENERAL] How to free disk space

2008-10-21 Thread Ruben Blanco
Hi: My database is growing fast taking too much disk space. How can I free disk space without performing a VACCUM FULL? It locks the database for several hours, and that is not a solution. I guess a backup-restore would do the work but, isn't there a better way to do this without shutting down

exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Ivan Sergio Borgonovo
On Tue, 21 Oct 2008 10:29:52 +0200 Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: I came across this: http://grokbase.com/topic/2007/08/07/general-tsearch2-plainto-tsquery-with-or/r92nI5l_k9S4iKcWdCxKs05yFQk And I find it is strictly related to my needs. Working around ts_parse I could get an

Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-21 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: On Mon, 2008-10-20 at 18:45 -0400, Tom Lane wrote: In any case, do not use the wrong return type for the definition you're implementing. err...Why would anyone do that? That's what I wanted to know ;-). If these functions are really going to return

[GENERAL] Varchar vs varchar(64)

2008-10-21 Thread Rob Richardson
Greetings! The database we install at our customers as part of our product includes an event_history table. For some reason lost in the mists of time, the most important field in that table, the description, is a varchar field specified to be only 64 characters long. This leads me to a more

Re: [GENERAL] How best to implement a multi-table constraint?

2008-10-21 Thread Matthias Karlsson
Why do you need to store the total area at all (property_area)? This value can easily be calculated with an group by query. On Mon, Oct 20, 2008 at 10:56 PM, Karl Nack [EMAIL PROTECTED] wrote: Hello all, I'm a bit of a newb designing a database to hold landcover information for properties in

Re: [GENERAL] How to free disk space

2008-10-21 Thread postgres Emanuel CALVO FRANCO
After run VACUUM, you must run REINDEXDB to decrease indexes. You can pg_resetxlog too, but you need restart server to do that. 2008/10/21 Ruben Blanco [EMAIL PROTECTED]: Hi: My database is growing fast taking too much disk space. How can I free disk space without performing a VACCUM FULL?

Re: [GENERAL] Session variables (how do I pass session data to a function)

2008-10-21 Thread Philip W. Dalrymple
Just to complete the answer in this thread; the trick is to do the following: - define in your postgresql.conf: custom_variable_classes = 'myvar' Then see http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADMIN-SET-TABLE ( with the variables named myvar.*) thanks for

Re: [GENERAL] Varchar vs varchar(64)

2008-10-21 Thread Philip W. Dalrymple
Well, I would guess that whoever designed the DB structure was used to non-Postgres databases. First see http://www.postgresql.org/docs/8.3/static/datatype-character.html for the tip in Para. 7 on that page. Most Data Bases DO require much more effort (i.e. don't run as fast) if you use

Re: [GENERAL] How to free disk space

2008-10-21 Thread Devrim GÜNDÜZ
On Tue, 2008-10-21 at 11:59 +0100, Ruben Blanco wrote: My database is growing fast taking too much disk space. Are you running regular vacuum? -- Devrim GÜNDÜZ, RHCE devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org signature.asc

[GENERAL] syncing with a MySQL DB

2008-10-21 Thread Brandon Metcalf
I have a need to keep a PostgreSQL and MySQL table synchronized. My thoughts are to use triggers on the pgsql side to manipulate the MySQL table when data in the pgsql table is changed. I also plan on using PL/Perl to write the functions. Are there better ways to achieve this? -- Brandon --

Re: [GENERAL] syncing with a MySQL DB

2008-10-21 Thread Merlin Moncure
On Tue, Oct 21, 2008 at 9:07 AM, Brandon Metcalf [EMAIL PROTECTED] wrote: I have a need to keep a PostgreSQL and MySQL table synchronized. My thoughts are to use triggers on the pgsql side to manipulate the MySQL table when data in the pgsql table is changed. I also plan on using PL/Perl to

[GENERAL] Where are updates from inside transactions visible?

2008-10-21 Thread Rob Richardson
Greetings again! Suppose I have a table named myTable with fields named item and value. Item X has a value of 1. Inside a C++ application, I begin a transaction, open the table, change Item X's value to 2, and go to sleep. The transaction is still active. In PGAdmin, I open an SQL window and

Re: [GENERAL] syncing with a MySQL DB

2008-10-21 Thread Brandon Metcalf
m == [EMAIL PROTECTED] writes: m On Tue, Oct 21, 2008 at 9:07 AM, Brandon Metcalf [EMAIL PROTECTED] wrote: m I have a need to keep a PostgreSQL and MySQL table synchronized. My m thoughts are to use triggers on the pgsql side to manipulate the MySQL m table when data in the pgsql table is

Re: [GENERAL] syncing with a MySQL DB

2008-10-21 Thread Merlin Moncure
On Tue, Oct 21, 2008 at 9:54 AM, Brandon Metcalf [EMAIL PROTECTED] wrote: m == [EMAIL PROTECTED] writes: m On Tue, Oct 21, 2008 at 9:07 AM, Brandon Metcalf [EMAIL PROTECTED] wrote: m I have a need to keep a PostgreSQL and MySQL table synchronized. My m thoughts are to use triggers on

[GENERAL] When are updates from inside transactions visible?

2008-10-21 Thread Rob Richardson
Correction from my previous post. The first word in the title should have been when, not where. RobR -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] syncing with a MySQL DB

2008-10-21 Thread Brandon Metcalf
m == [EMAIL PROTECTED] writes: m On Tue, Oct 21, 2008 at 9:54 AM, Brandon Metcalf [EMAIL PROTECTED] wrote: m m == [EMAIL PROTECTED] writes: m m m On Tue, Oct 21, 2008 at 9:07 AM, Brandon Metcalf [EMAIL PROTECTED] wrote: m m I have a need to keep a PostgreSQL and MySQL table

Re: exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Ivan Sergio Borgonovo
On Tue, 21 Oct 2008 13:20:12 +0200 Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: On Tue, 21 Oct 2008 10:29:52 +0200 Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: I came across this: http://grokbase.com/topic/2007/08/07/general-tsearch2-plainto-tsquery-with-or/r92nI5l_k9S4iKcWdCxKs05yFQk

Re: [GENERAL] index scan leads to result that is different from sec scan after upgrading to 8.3.4

2008-10-21 Thread Sergey Konoplev
Ok, I've done the test case (see attachment). 8.3.3 has passed it. 8.3.4 hasn't passed in ~99% times I run it. Steps to reproduce: 1. install pg 8.3.4, do initdb, start pg 2. correct PSQL parameter in pg-8.3.4_index_update_test.sh 3. run pg-8.3.4_index_update_test.sh few times And you will see

Re: [GENERAL] How to free disk space

2008-10-21 Thread Raymond O'Donnell
On 21/10/2008 11:59, Ruben Blanco wrote: My database is growing fast taking too much disk space. How can I free disk space without performing a VACCUM FULL? It locks the database for several hours, and that is not a solution. You shouldn't need to do VACUUM FULL - plain VACUUM should do the

Re: [GENERAL] index scan leads to result that is different from sec scan after upgrading to 8.3.4

2008-10-21 Thread Sergey Konoplev
Ok, I've done the test case (see attachment). 8.3.3 has passed it. 8.3.4 hasn't passed in ~99% times I run it. Steps to reproduce: 1. install pg 8.3.4, do initdb, start pg 2. correct PSQL parameter in pg-8.3.4_index_update_test.sh 3. run pg-8.3.4_index_update_test.sh few times And you will see

Re: [GENERAL] [HACKERS] Hot Standby utility and administrator functions

2008-10-21 Thread Simon Riggs
On Tue, 2008-10-21 at 09:44 +0200, Zeugswetter Andreas OSB sIT wrote: * pg_last_recovered_xact_xid() Will throw an ERROR if *not* executed in recovery mode. returns bigint * pg_last_completed_xact_xid() Will throw an ERROR *if* executed in recovery mode. returns bigint

Re: [GENERAL] Where are updates from inside transactions visible?

2008-10-21 Thread Craig Ringer
Rob Richardson wrote: Greetings again! Suppose I have a table named myTable with fields named item and value. Item X has a value of 1. Inside a C++ application, I begin a transaction, open the table, change Item X's value to 2, and go to sleep. The transaction is still active. In

Re: [GENERAL] Need Tool to sync databases with 8.3.1

2008-10-21 Thread Jozef Sevcik
Hi all, reopening this thread, because I just received e-mail from EMS that they just release EMS DB Comparer with PostgreSQL 8.3 support. I'm going to evaluate this, so I realized people here may be interested. http://sqlmanager.net/en/products/postgresql/dbcomparer/download Thanks, Jozef

Re: exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Tom Lane
Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: It would still be nice to be able to directly work with tsvector and tsquery so people could exploit the parser, lexer etc... and recycle the config. I'd thinking something in the line of for lex in select * from to_tsvector('jsjdjd fdsds')

Re: [GENERAL] When are updates from inside transactions visible?

2008-10-21 Thread Rob Richardson
Answering my own question: The change is not visible until the commit, which is what I was expecting and hoping. I added a couple of buttons to a dialog box in an application that connected to our database. In the handler for one button, I began a transaction and updated a value. In the handler

Re: [GENERAL] [PERFORM] Backup strategies

2008-10-21 Thread Howard Cole
Reuven M. Lerner wrote: I'm running a medium-traffic Web site that has been running for a few years, and which uses about four PostgreSQL databases on a regular basis. I'm currently running 8.2, although I'm planning to upgrade to 8.3 in the coming week or two, in part because of the problems

Re: [GENERAL] Varchar vs varchar(64)

2008-10-21 Thread Albe Laurenz
Rob Richardson wrote: The database we install at our customers as part of our product includes an event_history table. For some reason lost in the mists of time, the most important field in that table, the description, is a varchar field specified to be only 64 characters long. This

Re: [GENERAL] How best to implement a multi-table constraint?

2008-10-21 Thread Karl Nack
I agree, but it seems to me that property_area isn't a strictly derived value. It's possible to change the makeup of a property's landcover -- for example, remove some concrete and plant more grass, or add an extension to the building -- but the overall property area should remain constant. I

Re: [GENERAL] Annoying Reply-To

2008-10-21 Thread Peter Eisentraut
On Friday 17 October 2008 22:01:33 Guy Rouillier wrote: When I use Reply All in Thunderbird, it adds a To: to each of the individuals in the discussion, and a CC: to the list.  Since I personally don't like receiving multiple copies of emails from this list, I delete all of the To: addressees

Re: exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Ivan Sergio Borgonovo
On Tue, 21 Oct 2008 10:36:20 -0400 Tom Lane [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: It would still be nice to be able to directly work with tsvector and tsquery so people could exploit the parser, lexer etc... and recycle the config. I'd thinking

Re: [GENERAL] How best to implement a multi-table constraint?

2008-10-21 Thread Karl Nack
I agree, but it seems to me that property_area isn't a strictly derived value. It's possible to change the makeup of a property's landcover -- for example, remove some concrete and plant more grass, or add an extension to the building -- but the overall property area should remain constant. I

Re: [GENERAL] index scan leads to result that is different from sec scan after upgrading to 8.3.4

2008-10-21 Thread Teodor Sigaev
Thank you, I reproduce the bug, will fix. Sergey Konoplev wrote: Ok, I've done the test case (see attachment). 8.3.3 has passed it. 8.3.4 hasn't passed in ~99% times I run it. Steps to reproduce: 1. install pg 8.3.4, do initdb, start pg 2. correct PSQL parameter in

Re: [GENERAL] How to free disk space

2008-10-21 Thread Robert Treat
On Tuesday 21 October 2008 09:00:30 postgres Emanuel CALVO FRANCO wrote: After run VACUUM, you must run REINDEXDB to decrease indexes. This is probably overkill, as you won't need to do this for a lot of tables in your database, and the locking issues are probably unhelpful. You can

Re: [GENERAL] Varchar vs varchar(64)

2008-10-21 Thread Tom Lane
Albe Laurenz [EMAIL PROTECTED] writes: Rob Richardson wrote: Are there other reasons to use varchar(64) instead of varchar? You can't have varchar without a length in parentheses, as far as I know. That's what the spec says and that's what some other implementations require, but not

Re: exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Tom Lane
Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: I missed it. Thanks. Nearly perfect. Now I've to understand what a {} is. An array with a null element? an empty array? an array containing ''? Hmm ... it appears that ts_lexize is returning a one-dimensional array of no elements, whereas

[GENERAL] tsearch2: setting weights on tsquery plainto_tsquery with | or and weight

2008-10-21 Thread Ivan Sergio Borgonovo
On Tue, 21 Oct 2008 13:40:33 -0400 Tom Lane [EMAIL PROTECTED] wrote: Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: I missed it. Thanks. Nearly perfect. Now I've to understand what a {} is. An array with a null element? an empty array? an array containing ''? Hmm ... it appears that

[GENERAL] Slow to delete TOAST table data

2008-10-21 Thread Glen Brown
Hello, I am in need of some help figuring out what is going on with this query. I am cleaning up some data. This data set is about 3.5 million records and I am trying to purge out 400k of them. I was able to remove this data quickly from some of the related tables that had no TOAST data associated

Re: [GENERAL] Re: BUG #4078: ERROR: operator does not exist: numeric = character varying

2008-10-21 Thread Eric Haszlakiewicz
On Mon, Oct 13, 2008 at 09:10:41PM -0400, Tom Lane wrote: Eric Haszlakiewicz [EMAIL PROTECTED] writes: I created this, which seems to solve the problem: create function casting_eq_operator(integer, char) returns boolean as 'begin return $1 = cast ($2 as integer); end;'

Re: [GENERAL] psql: what's the SQL to compute the ratio of table sizes?

2008-10-21 Thread Josh Williams
On Fri, 2008-10-17 at 15:30 -0400, Kynn Jones wrote: Suppose I have two table X and Y and I want to compute the ratio of the number of rows in X and the number of rows in Y. What would be the SQL I could type into a psql session to get this number? Sub-selects should work. And make sure to

[GENERAL] How to get schema name which violates fk constraint

2008-10-21 Thread Andrus
FK violation erroro is displayed as 7/23503:ERROR: insert or update on table summak violates foreign key constraint summak_kontonr_fkey1 Key (kontonr)=(2421 ) is not present in table konto. I have large numbers of schemas all containing tables with same name. How to determine schema

[GENERAL] Optimizing queries with projected columns

2008-10-21 Thread Andrus
I have lot of autogenerated from projection queries in form SELECT source.c1, source.c2, t1.col1, t1.col2, ... FROM (SELECT c1, c2, c3, . , c20 FROM ... WHERE ... ) source LEFT JOIN t2 USING (somecolumn) Main SELECT uses only few columns (source.c1 and source.c2 in this sample) from source

[GENERAL] create parent after children

2008-10-21 Thread carlos . ohiggins
Hello Guys, I need to create a postgres 7.3 (done that, its bundled with an app I have to extend). Now I need to create 2 tables one a table of events. usual mix of column types, with varchar as primary key. However when I get 3 events in with specific characteristics I need to create a summary

[GENERAL] text array accumulate to multidimensional text array

2008-10-21 Thread Rainer Zaiss
Dear list, I would like to aggregate a text array into a multidimensional text array. Let us say I have one table with two collumns IDARRAY A{A1,B1,C1} A{A2,B2,C2} B {A3,B3,C3} If I use a GROUP BY ID, I would like to receive following result: ID ARRAY A

Re: [GENERAL] Annoying Reply-To

2008-10-21 Thread Aidan Van Dyk
* Guy Rouillier [EMAIL PROTECTED] [081001 00:00]: Bill Moran wrote: You can resent it or not, but this _is_ a personal thing. It's personal because you are the only one complaining about it. Despite the large number of people on this list, I don't see anyone jumping in to defend you. I'm

[GENERAL] statement_timeout by host?

2008-10-21 Thread Dave Fry
Hello. Is it possible to set a statement_timeout by host, such that requests from only that host will be limited?

Re: [GENERAL] statement_timeout by host?

2008-10-21 Thread Jeff Davis
On Mon, 2008-10-20 at 17:22 -0700, Dave Fry wrote: Hello. Is it possible to set a statement_timeout by host, such that requests from only that host will be limited? Can you set it by user instead, and have different hosts connect using different users? ALTER USER foo SET

Re: [GENERAL] text array accumulate to multidimensional text array

2008-10-21 Thread Merlin Moncure
On Tue, Oct 14, 2008 at 9:22 AM, Rainer Zaiss [EMAIL PROTECTED] wrote: Dear list, I would like to aggregate a text array into a multidimensional text array. Let us say I have one table with two collumns IDARRAY A{A1,B1,C1} A{A2,B2,C2} B {A3,B3,C3} If I use a GROUP BY

Re: [GENERAL] Annoying Reply-To

2008-10-21 Thread Guy Rouillier
Aidan Van Dyk wrote: But now, if the list munged my reply-to, how would you get back to me? I wouldn't ;). The whole point of a mailing list is to have discussions with the list. If I wanted to correspond with you directly, I wouldn't use the list for that. -- Guy Rouillier -- Sent via

Re: [GENERAL] How to get schema name which violates fk constraint

2008-10-21 Thread Scott Marlowe
Actually this sounds like a TODO to me. I imagine the db knows the schema and it's just not reporting it in the error message. Bruce? Tom? On Tue, Oct 14, 2008 at 9:43 AM, Andrus [EMAIL PROTECTED] wrote: FK violation erroro is displayed as 7/23503:ERROR: insert or update on table summak

Re: [GENERAL] How to free disk space

2008-10-21 Thread Scott Marlowe
On Tue, Oct 21, 2008 at 10:46 AM, Robert Treat [EMAIL PROTECTED] wrote: On Tuesday 21 October 2008 09:00:30 postgres Emanuel CALVO FRANCO wrote: After run VACUUM, you must run REINDEXDB to decrease indexes. This is probably overkill, as you won't need to do this for a lot of tables in your

[GENERAL] [ANN] VTD-XML extended edition released

2008-10-21 Thread jimmy Zhang
The Java version of extended VTD-XmL is released and available for download. This version supports 256 GB max file sizes and memory mapped capabilities. The updated documentation is also available for download. In short, you can basically do full XPath query on documents that are bigger than

Re: [GENERAL] Annoying Reply-To

2008-10-21 Thread Greg Smith
On Fri, 17 Oct 2008, Aidan Van Dyk wrote: But now, if the list munged my reply-to, how would you get back to me? Why'd you have to interrupt a perfectly good, unwinnable idealogical argument with a technical question? While there is only one reply-to allowed for a message, you can put