Re: [GENERAL] FIN_WAIT_2

2007-04-27 Thread Michael Fuhr
On Tue, Apr 24, 2007 at 06:32:31PM -0400, [EMAIL PROTECTED] wrote: > I installed postgresql 8.2.3 in a freebsd server, my client application is > written in C++ builder + zeoslib and I haven't any problem until now, but now > with 8.2.3 version I have many connection that remains in FIN_WAIT_2, any

Re: [GENERAL] Query in function not using index...

2007-04-27 Thread John Cole
Tom, We were looking at the explain results and noticed that it was converting the 'wynn%' into fname >= 'wynn' and fname < 'wyno' So we modified our function to mimic this transformation, where we have two variables that contain the 'wynn' and 'wyno': Fname >= @var1 and fname < @var2

Re: [GENERAL] Query in function not using index...

2007-04-27 Thread Tom Lane
Listmail <[EMAIL PROTECTED]> writes: >> Any idea why using a variable v_streetName instead of a string 'wynn%' >> behaves differently? > Yeah. > 'wynn%' doesn't start with % so LIKE uses index. > But Postgres doesn't know that you know that the contents of this > variable never

[GENERAL] Indice en Date

2007-04-27 Thread Arturo Munive
tengo un indice sobre una columna date. cuando hago una consulta ... Select     id from     ventas WHERE     fecha = date('12-JAN-2007') el planificador usa el indice pero cuando la restriccion es WHERE fecha < date('12-JAN-2007') se efectua un barrido secuencial. ni e indice ni la tabl

Re: [GENERAL] Preferred Installation/Data Directories

2007-04-27 Thread Russ Brown
Rich Shepard wrote: > On Fri, 27 Apr 2007, Ron Johnson wrote: > >> Why put "active" data under /usr? Ever since user data was moved to >> home, >> /usr has only had system stuff in it. Or is that still a viable BSDism? > > Good question, Ron! But, in a multiuser system with many users of the

Re: [GENERAL] Query in function not using index...

2007-04-27 Thread Listmail
Any idea why using a variable v_streetName instead of a string 'wynn%' behaves differently? Yeah. 'wynn%' doesn't start with % so LIKE uses index. But Postgres doesn't know that you know that the contents of this variable never starts with '%'... Thanks, John ---

Re: [GENERAL] Preferred Installation/Data Directories

2007-04-27 Thread Rich Shepard
On Fri, 27 Apr 2007, Ron Johnson wrote: Why put "active" data under /usr? Ever since user data was moved to home, /usr has only had system stuff in it. Or is that still a viable BSDism? Good question, Ron! But, in a multiuser system with many users of the database, in whose /home directory

Re: [GENERAL] 8.2.3 AutoVacuum not running

2007-04-27 Thread Alvaro Herrera
Schwenker, Stephen wrote: > Hello, > > I've just compiled an instance of Postgresql 8.2.3 on a new linux box > and have added some databases to it. I've noticed however that the > autovacuum is not running. I have turned on the autovacuum, > stats_start_collector, and stats_row_level and still

Re: [GENERAL] postgres.exe - Entry point not found (PostgreSQL 8.3 devel)

2007-04-27 Thread Magnus Hagander
Marcelo de Moraes Serpa wrote: > Hello, > > I have compiled PostgreSQL 8.3devel using Microsoft Visual C++ 2005 but > when I tried to start it (either by using the initdb.exe or > postgres.exe) I receive the following error message: > > Message title: " postgres.exe - Entry point not found" > Mes

Re: [GENERAL] Processing a work queue

2007-04-27 Thread Chris Browne
[EMAIL PROTECTED] ("John D. Burger") writes: > I wrote: > >> I use a variant of The Tom Lane Solution previously pointed to, >> your Plan 1 is very similar. > > Hmm, per that pointed-to post: > > http://archives.postgresql.org/pgsql-general/2003-05/msg00351.php > > I decided to run a periodic vac

[GENERAL] postgres.exe - Entry point not found (PostgreSQL 8.3 devel)

2007-04-27 Thread Marcelo de Moraes Serpa
Hello, I have compiled PostgreSQL 8.3devel using Microsoft Visual C++ 2005 but when I tried to start it (either by using the initdb.exe or postgres.exe) I receive the following error message: Message title: "postgres.exe - Entry point not found" Message body: "It wasn't possible to find the entr

Re: [GENERAL] Store dates in database in different format

2007-04-27 Thread Jeff Davis
On Fri, 2007-04-27 at 11:09 -0700, RPK wrote: > I am using pgsql 8.2.3 on windows XP. I noticed that dates are store in > 'Date' columns of a table in "-mm-dd" format whereas I want to store it > in "dd-MMM-" format. Can I change this? First of all, you're talking about the input/output fo

Re: [GENERAL] Store dates in database in different format

2007-04-27 Thread Bill Moran
In response to RPK <[EMAIL PROTECTED]>: > > I am using pgsql 8.2.3 on windows XP. I noticed that dates are store in > 'Date' columns of a table in "-mm-dd" format whereas I want to store it > in "dd-MMM-" format. Can I change this? They're not stored in that format, they're just displayin

[GENERAL] Store dates in database in different format

2007-04-27 Thread RPK
I am using pgsql 8.2.3 on windows XP. I noticed that dates are store in 'Date' columns of a table in "-mm-dd" format whereas I want to store it in "dd-MMM-" format. Can I change this? -- View this message in context: http://www.nabble.com/Store-dates-in-database-in-different-format-tf365

[GENERAL] Query in function not using index...

2007-04-27 Thread John Cole
Hello, I need some help with a query inside a function. The table has 31M rows in it (us streets), and a select statement takes 10ms when using an index built for the query... But, when the same query is in a function and uses a variable the index isn't used and the query takes a few minutes.

Re: [GENERAL] Processing a work queue

2007-04-27 Thread John D. Burger
I decided to run a periodic vacuum on my work queue. Lo and behold, I get this: ERROR: tuple concurrently updated Which PG version is this, and do you have autovacuum enabled? 7.4.8, so no autovac, right? In addition, all of my workers locked up, apparently indefinitely. [ squint..

Re: [GENERAL] Preferred Installation/Data Directories

2007-04-27 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/27/07 09:50, Rich Shepard wrote: [snip] > > I see in postgresql.SlackBuild where the data directories are specified. > I'll change that from /var/lib/pgsql/data to /usr/local/pgsql/data and > rebuild the package. (Explicitly noting that this

Re: [GENERAL] Processing a work queue

2007-04-27 Thread Tom Lane
"John D. Burger" <[EMAIL PROTECTED]> writes: > I decided to run a periodic vacuum on my work queue. Lo and behold, > I get this: >ERROR: tuple concurrently updated Which PG version is this, and do you have autovacuum enabled? Awhile back it was possible to get this error if autovac and a

Re: [GENERAL] Processing a work queue

2007-04-27 Thread John D. Burger
I wrote: I use a variant of The Tom Lane Solution previously pointed to, your Plan 1 is very similar. Hmm, per that pointed-to post: http://archives.postgresql.org/pgsql-general/2003-05/msg00351.php I decided to run a periodic vacuum on my work queue. Lo and behold, I get this: ERR

Re: [GENERAL] Preferred Installation/Data Directories

2007-04-27 Thread Rich Shepard
On Fri, 27 Apr 2007, Tom Lane wrote: No, it hasn't. The PG code itself doesn't make any assumptions about the location of $PGDATA AFAIR, but there are a large number of packagings that assume specific places like /var/lib/pgsql/. If you've changed platforms or changed between installing from sou

Re: [GENERAL] Using a library compiled for 8.3 in 8.2

2007-04-27 Thread Alvaro Herrera
Marcelo de Moraes Serpa escribió: > Hello! > > Today, I have finally managed to compile PostgreSQL 8.3devel using Visual > C++ 2005 on Windows XP PRO. It was a tough process as I've never hacked such > a big OS project like PGSQL. I did it becouse I needed to develop some C > functions that will b

Re: [GENERAL] Preferred Installation/Data Directories

2007-04-27 Thread Tom Lane
Rich Shepard <[EMAIL PROTECTED]> writes: >Seems to me that the preferred filesystem for postgres has varied over the > years from /var/lib/ to /usr/local/ and back again. No, it hasn't. The PG code itself doesn't make any assumptions about the location of $PGDATA AFAIR, but there are a large

[GENERAL] Using a library compiled for 8.3 in 8.2

2007-04-27 Thread Marcelo de Moraes Serpa
Hello! Today, I have finally managed to compile PostgreSQL 8.3devel using Visual C++ 2005 on Windows XP PRO. It was a tough process as I've never hacked such a big OS project like PGSQL. I did it becouse I needed to develop some C functions that will be exported as functions to be called as Store

[GENERAL] Preferred Installation/Data Directories

2007-04-27 Thread Rich Shepard
Seems to me that the preferred filesystem for postgres has varied over the years from /var/lib/ to /usr/local/ and back again. When I upgraded from 7.4.3 to 8.1.4 the move was from /usr/local/ to /var/lib/. Now, as I prepare to upgrade and migrate data from 8.1.4 to 8.2.4, I see that the docs al

Re: [GENERAL] Vacuum-full very slow

2007-04-27 Thread Alvaro Herrera
Martijn van Oosterhout wrote: > On Thu, Apr 26, 2007 at 12:13:13AM +0200, Listmail wrote: > > VACUUM FULL is slow because it plays with the indexes... > > CLUSTER is slow because it has to order the rows... > > And: > VACUUM FULL has to seek/read/write all over the disk to get it's job > d

Re: [GENERAL] Converting time to float

2007-04-27 Thread Jorge Godoy
Richard Huxton <[EMAIL PROTECTED]> writes: >> SELECT '00:10:00'::TIME / '1:00:00'::TIME; -- Answer is: >> 0.1667 > > But it doesn't make any sense to divide one time by another, does it? Are you > sure it's not intervals you want? It "doesn't matter", I just used time because I

Re: [GENERAL] Converting time to float

2007-04-27 Thread Richard Huxton
Jorge Godoy wrote: Hi! I am needing to convert from TIME type to floats and taking 1h as the unit, so what I'd like is something that would allow me doing operations like: SELECT '00:10:00'::TIME / '1:00:00'::TIME; -- Answer is: 0.1667 But it doesn't make any sense to divi

Re: [GENERAL] Vacuum-full very slow

2007-04-27 Thread Martijn van Oosterhout
On Thu, Apr 26, 2007 at 12:13:13AM +0200, Listmail wrote: > VACUUM FULL is slow because it plays with the indexes... > CLUSTER is slow because it has to order the rows... And: VACUUM FULL has to seek/read/write all over the disk to get it's job done. CLUSTER can scan through the table

[GENERAL] Converting time to float

2007-04-27 Thread Jorge Godoy
Hi! I am needing to convert from TIME type to floats and taking 1h as the unit, so what I'd like is something that would allow me doing operations like: SELECT '00:10:00'::TIME / '1:00:00'::TIME; -- Answer is: 0.1667 SELECT '00:30:00'::TIME / '1:00:00'::TIME; -- Answer is: 0.

[GENERAL] Some problem with warm standby server

2007-04-27 Thread Nico Sabbi
Hi, I have some doubts regarding the settings and the access procedure of warm standby servers: - can autovacuum be safely enabled on the replicator? - I'm using pg_standby (from cvs) that is generally working well as expected (logs are copied with scp); today I wanted to temporarily stop the

Re: [GENERAL] Business days

2007-04-27 Thread A. Kretschmer
am Fri, dem 27.04.2007, um 8:18:55 +0100 mailte Peter Childs folgendes: > >Sure, that's an alternative, but it seems a bit too much reinventing an > >already existing wheel. I was amused to see the script had the ill-fated > >Lee-Jackson-King day in it. Ideally, we'd want a Postgres table that >

Re: [GENERAL] binary representation of date and numeric

2007-04-27 Thread Richard Huxton
Felix Kater wrote: Hi, what is the binary representation of 'date' and 'numeric' data? I am using PQexecParam (C binding libpq-8.0.12) with binary export switched on. From the three examples in C code the types 'int4', 'bytea' and strings are covered, however nothing about 'date', 'numeric'. I

[GENERAL] binary representation of date and numeric

2007-04-27 Thread Felix Kater
Hi, what is the binary representation of 'date' and 'numeric' data? I am using PQexecParam (C binding libpq-8.0.12) with binary export switched on. From the three examples in C code the types 'int4', 'bytea' and strings are covered, however nothing about 'date', 'numeric'. If there is no documen

Re: [GENERAL] PostgreSQL upgrade server A -> server B

2007-04-27 Thread Hannes Dorbath
On 27.04.2007 03:09, CAJ CAJ wrote: Forgive me if this has been discussed before (or if it sounds absurd) Upgrading large postgres databases (100GB+) takes awfully long time when doing dump/restore. I was wondering if this process can be optimized by directly dumping to a new version of Pg datab

Re: [GENERAL] Business days

2007-04-27 Thread Peter Childs
On 26/04/07, Greg Sabino Mullane <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 >> However, you quickly run into the problem of holidays. While you >> could construct a helper table listing all the holidays, ones that >> don't fall on the same day every year (e.g