Re: [GENERAL] strpos NOT doing what I'd expect

2008-06-06 Thread Tom Lane
Ralph Smith <[EMAIL PROTECTED]> writes: > DECLARE >achar character := '' ; Use varchar or text. character is weird about trailing spaces. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: h

Re: [GENERAL] PL/pgSQL graph enumeration function hangs

2008-06-06 Thread Tom Lane
"Charles F. Munat" <[EMAIL PROTECTED]> writes: > Using pseudocode from Celko's "SQL for Smarties" book, I wrote the > following function that builds a path enumeration table. I hope to > trigger this function on the rare occasions that the organizations table > is updated. But when I run this funct

[GENERAL] strpos NOT doing what I'd expect

2008-06-06 Thread Ralph Smith
CODE: === CREATE OR REPLACE FUNCTION find_next_delim(invar varchar, delimlist varchar) RETURNS integer AS $$ /* OVERLOADED Function. The other version takes a 3rd parameter as the starting position in invar. */ DECLARE achar character := '

[GENERAL] array column and b-tree index allowing only 8191 bytes

2008-06-06 Thread Celso Pinto
Hi all, I'm checking out some features in pgsql and found out about an array datatype. As I'm curious to find out how well it performs, I've created a table that contains an integer[] column and a script to insert about 500K rows in it. The length for the integer[] column is random (can be 10, can

Re: [GENERAL] Application EventLog: could not write to log file: Bad file descriptor

2008-06-06 Thread Alvaro Herrera
Ati Rosselet escribió: > Using postgresql 8.3 on windows 2003 server. I keep seeing this message in > my system log. Checking the times, it seems to coincide with a log > rollover each time, almost as though the db were trying to log something at > precisely the same time as it is closing access

Re: [GENERAL] when to reindex?

2008-06-06 Thread Gregory Stark
"Kevin Hunter" <[EMAIL PROTECTED]> writes: > Or, assuming the REINDEX is for speed/bloat, not for corruption, perhaps > an option to use the old index as a basis, rather than scanning the > entire table multiple times as with a CREATE INDEX CONCURRENTLY. That's been mentioned, it ought to be on t

Re: [GENERAL] when to reindex?

2008-06-06 Thread Craig Ringer
Roberts, Jon wrote: Based on this, I have the fillfactor set lower than the default 90 but this will fill up and it will run slower over time. I want to automate the reindex process but only reindex when needed. I have a pretty large database so I can't reindex everything regardless if it need

Re: [GENERAL] Heavily fragmented table and index data in 8.0.3

2008-06-06 Thread Gregory Stark
"Zoltan Boszormenyi" <[EMAIL PROTECTED]> writes: > Also, VACUUM FULL also takes too much time, on an otherwise idle database, I > worked on a copy of their live database. During VACUUM, _bt_getbuf() was > also called repeatedly with the block number jumping up and down. VACUUM or VACUUM FULL? VA

Re: [GENERAL] when to reindex?

2008-06-06 Thread Kevin Hunter
At 2:02p -0400 on Fri, 06 Jun 2008, Jon Roberts wrote: > Based on this, I have the fillfactor set lower than the default 90 but > this will fill up and it will run slower over time. I want to automate > the reindex process but only reindex when needed. I have a pretty large > database so I can't

Re: [GENERAL] Re: how to clean up temporary schemas (how to sync the system table with pg_dump)

2008-06-06 Thread Tom Lane
Gary Fu <[EMAIL PROTECTED]> writes: > Thanks for the response. Yes, normally it will be okay. However, when > I tried PgAdmin with Pgpool, it will cause problem. The PgAdmin will > try to access pg_namespace when making a connection to a db, if the > temporary schemas are different between the b

Re: [GENERAL] intagg memory leak

2008-06-06 Thread Tom Lane
Sam Mason <[EMAIL PROTECTED]> writes: > I'm seeing big memory leaks when doing a query like: > SELECT d.source_loc_id, d.movement_date - '2006-1-1', > array_to_string(int_array_aggregate(l.source_ls_id),' ') AS livestockids > FROM movedates d, livestock_locations l > WHERE l.source_loc_i

Re: [GENERAL] when to reindex?

2008-06-06 Thread Roberts, Jon
> On Fri, Jun 6, 2008 at 9:36 AM, Roberts, Jon <[EMAIL PROTECTED]> > wrote: > > In Oracle, there is a method to determine when it is advisable to > > rebuild indexes. Are there any guidelines for this in PostgreSQL? > > > > I found this but it doesn't indicate at which point an index should be > >

[GENERAL] Re: how to clean up temporary schemas (how to sync the system table with pg_dump)

2008-06-06 Thread Gary Fu
Tom Lane wrote: Gary Fu <[EMAIL PROTECTED]> writes: My question now is why those temporary schemas won't be cleaned after I restart the db ? Just leave them alone and you'll be fine. These tools actually have had most of the bugs worked out of them ;-) ... if you think pg_dump is omitting som

Re: [GENERAL] Annoying messages when copy sql code to psql terminal

2008-06-06 Thread Reece Hart
On Thu, 2008-06-05 at 22:28 -0400, Merlin Moncure wrote: > As others have noted, you have tabs in your sql source. I'd advise if > possible, not to use the tab character in sql, for this and other > reasons. Tabs in SQL are a problem only if you copy-paste. If your editor and psql can see the s

Re: [GENERAL] Annoying messages when copy sql code to psql terminal

2008-06-06 Thread Scott Marlowe
On Fri, Jun 6, 2008 at 6:12 AM, Merlin Moncure <[EMAIL PROTECTED]> wrote: > On Fri, Jun 6, 2008 at 12:39 AM, Gurjeet Singh <[EMAIL PROTECTED]> wrote: >> On Fri, Jun 6, 2008 at 7:58 AM, Merlin Moncure <[EMAIL PROTECTED]> wrote: >>> As others have noted, you have tabs in your sql source. I'd advise

Re: [GENERAL] when to reindex?

2008-06-06 Thread Scott Marlowe
On Fri, Jun 6, 2008 at 9:36 AM, Roberts, Jon <[EMAIL PROTECTED]> wrote: > In Oracle, there is a method to determine when it is advisable to > rebuild indexes. Are there any guidelines for this in PostgreSQL? > > I found this but it doesn't indicate at which point an index should be > rebuilt other

Re: [GENERAL] Problems with pg_dump ?

2008-06-06 Thread Tom Lane
Alexandr Popov <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE VIEW v1 AS SELECT DISTINCT a,b, -1 AS d, -1 AS e FROM t1; > After this i dump database with pg_dump and have following output. > CREATE VIEW v1 AS > SELECT DISTINCT t1.a, t1.b, -1 AS d, -1 AS e FROM t1 ORDER BY t1.a, t1.b, > -1::

Re: [GENERAL] Extracting data from deprecated MONEY fields

2008-06-06 Thread Shane Ambler
Ken Winter wrote: Thanks, Joshua ~ What you suggest is basically what I'm trying to do. Where I'm stuck is in finding a construct (a CAST or whatever) to turn the existing "money" column data (directly or indirectly) into numeric. I've tried to convert a column named "amount" in the following

Re: [GENERAL] Extracting data from deprecated MONEY fields

2008-06-06 Thread Adrian Klaver
On Friday 06 June 2008 8:49 am, Adrian Klaver wrote: > On Friday 06 June 2008 8:25 am, Ken Winter wrote: > > Thanks, Joshua ~ > > > > What you suggest is basically what I'm trying to do. Where I'm stuck is > > in finding a construct (a CAST or whatever) to turn the existing "money" > > column data

Re: [GENERAL] Extracting data from deprecated MONEY fields

2008-06-06 Thread Ken Winter
Thanks Adrian ~ See comments at end. > -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-general- > [EMAIL PROTECTED] On Behalf Of Adrian Klaver > Sent: Friday, June 06, 2008 11:49 AM > To: pgsql-general@postgresql.org > Cc: Ken Winter > Subject: Re: [GENERAL] Extracting data from

Re: [GENERAL] Extracting data from deprecated MONEY fields

2008-06-06 Thread Adrian Klaver
On Friday 06 June 2008 8:25 am, Ken Winter wrote: > Thanks, Joshua ~ > > What you suggest is basically what I'm trying to do. Where I'm stuck is in > finding a construct (a CAST or whatever) to turn the existing "money" > column data (directly or indirectly) into numeric. I've tried to convert a

[GENERAL] when to reindex?

2008-06-06 Thread Roberts, Jon
In Oracle, there is a method to determine when it is advisable to rebuild indexes. Are there any guidelines for this in PostgreSQL? I found this but it doesn't indicate at which point an index should be rebuilt other than corruption. http://www.postgresql.org/docs/8.3/interactive/routine-reindex

Re: [GENERAL] Extracting data from deprecated MONEY fields

2008-06-06 Thread Ken Winter
Thanks, Joshua ~ What you suggest is basically what I'm trying to do. Where I'm stuck is in finding a construct (a CAST or whatever) to turn the existing "money" column data (directly or indirectly) into numeric. I've tried to convert a column named "amount" in the following ways, with the follo

[GENERAL] intagg memory leak

2008-06-06 Thread Sam Mason
Hi, I've been using the intagg code to perform aggregations under the assumption that it's going to be more efficient than the array_accum documented elsewhere[1]. I'm seeing big memory leaks when doing a query like: SELECT d.source_loc_id, d.movement_date - '2006-1-1', array_to_string(int

[GENERAL] Heavily fragmented table and index data in 8.0.3

2008-06-06 Thread Zoltan Boszormenyi
Hi, we have a customer with PostgreSQL 8.0.3 with a quite interesting problem. They have around 24 identical databases and all but one is working nicely. The one that doesn't work nicely show this problem: INSERT "hangs" on an apparently empty table where "select count(*)" returns 0 quite quickly.

Re: [GENERAL] Re: Accessing other databases with DBLink when leaving user/password empty

2008-06-06 Thread Adrian Klaver
On Friday 06 June 2008 2:32 am, Hermann Muster wrote: > Does no one have any idea about that? > > Regards. > > Hermann Muster wrote: > > Hi, > > > > I have the following problem when trying to access other PostgreSQL > > databases with DBLink. I followed the instructions on > > http://www.postgreso

[GENERAL] Problems with pg_dump ?

2008-06-06 Thread Alexandr Popov
Hello, I found small problem and doesn't know where to dig. Ok let's start. postgresql 8.2.7 OS - linux Create table and view. CREATE TABLE t1 ( a integer NOT NULL, b integer NOT NULL ); CREATE OR REPLACE VIEW v1 AS SELECT DISTINCT a,b, -1 AS d, -1 AS e FROM t1; After this i dump da

Re: [GENERAL] Annoying messages when copy sql code to psql terminal

2008-06-06 Thread Merlin Moncure
On Fri, Jun 6, 2008 at 12:39 AM, Gurjeet Singh <[EMAIL PROTECTED]> wrote: > On Fri, Jun 6, 2008 at 7:58 AM, Merlin Moncure <[EMAIL PROTECTED]> wrote: >> As others have noted, you have tabs in your sql source. I'd advise if >> possible, not to use the tab character in sql, for this and other >> rea

[GENERAL] Questions about index usage

2008-06-06 Thread Viktor Rosenfeld
Hi, I have a query with the following joins: annotations2.attribute = 'pos' AND annotations2.value = 'KOUS' AND annotations4.span = 'man' AND annotations6.span = 'sich' AND annotations2.text_ref = annotations4.text_ref AND annotations2.right = anno

Re: [GENERAL] Temporary Tables and Web Application

2008-06-06 Thread Tim Tassonis
Tomasz Ostrowski wrote: On 2008-06-06 07:25, Brent Wood wrote: Would "real" tables in a tablespace defined on a ramdisk meet this need? Bad idea. This would mean an unusable database after a restart. Funnily, I was thinking the same this night, somehow defining a tablespace on tmpfs or som

[GENERAL] Re: Accessing other databases with DBLink when leaving user/password empty

2008-06-06 Thread Hermann Muster
Does no one have any idea about that? Regards. Hermann Muster wrote: Hi, I have the following problem when trying to access other PostgreSQL databases with DBLink. I followed the instructions on http://www.postgresonline.com/journal/index.php?/archives/44-Using-DbLink-to-access-other-Postg

Re: [GENERAL] Temporary Tables and Web Application

2008-06-06 Thread Tomasz Ostrowski
On 2008-06-06 07:25, Brent Wood wrote: > Would "real" tables in a tablespace defined on a ramdisk meet this > need? Bad idea. This would mean an unusable database after a restart. > You could also mount a tablespace on a physical disk with a > filesystem which has delayed/deferred writes to disk

Re: [GENERAL] Full vacuum really slowing query down

2008-06-06 Thread Tomasz Ostrowski
On 2008-06-04 23:18, Jason Long wrote: > I have a query that takes 2.5 sec if I run it from a freshly restored > dump. If I run a full vacuum on the database it then takes 30 seconds. 1. Don't run "vacuum full", run plain "vacuum". If you run "vacuum full" then "reindex" afterwards. 2. Run "an