Re: [GENERAL] Question regarding autovacuum in 8.1

2007-08-29 Thread Denis Gasparin
Alvaro Herrera ha scritto: >> However i have no idea of what tables the autovacuum daemon is >> processing because there aren't autovacuum info columns on >> pg_stat_all_tables (as there are for 8.2.x). >> > > For that, you need to change log_min_messages to debug2. > > Keep track of the PID o

Re: [GENERAL] Can this function be declared IMMUTABLE?

2007-08-29 Thread Josh Tolley
On 8/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I have a question about whether I can safely declare a function IMMUTABLE. > Citing the documentation under "Function Volatility Categories" in the > section on "Extending SQL": > > It is

Re: [GENERAL] Can this function be declared IMMUTABLE?

2007-08-29 Thread Jaime Casanova
On 8/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Well, I am considering a function that does read from a table, but the > table contents change extremely infrequently (the table is practically a > list of constants). Would it be safe to declare the function IMMUTABLE > provided that the

Re: [GENERAL] What kind of locks does vacuum process hold on the db?

2007-08-29 Thread Scott Marlowe
On 8/29/07, Nitin Verma <[EMAIL PROTECTED]> wrote: > What kind of locks does it hold on the db? Table level / Row level / > AccessExclusiveLock ? > Is there a document that details vacuum process, and its internals? > > > Use case: I am doing a vacuum {all full analyze} on a postgres 8.1 hosting >

[GENERAL] What kind of locks does vacuum process hold on the db?

2007-08-29 Thread Nitin Verma
What kind of locks does it hold on the db? Table level / Row level / AccessExclusiveLock ? Is there a document that details vacuum process, and its internals? Use case: I am doing a vacuum {all full analyze} on a postgres 8.1 hosting two user databases. For this I am using ${pg-home}/bin/vacuumdb

Re: [GENERAL] how to print a schema

2007-08-29 Thread Rodrigo De León
On 8/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Does anybody know how to print a schema in PostgreSQL? I know you can > look at one table at at time, but is there a way to print all columns > and rows at once? 1. pg_dump / pg_dumpall http://www.postgresql.org/docs/8.2/static/backup-d

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gregory Stark wrote: > "Joshua D. Drake" <[EMAIL PROTECTED]> writes: > >> Tom Lane wrote: >>> "Joshua D. Drake" <[EMAIL PROTECTED]> writes: Tom Lane wrote: > "Joshua D. Drake" <[EMAIL PROTECTED]> writes: >> SERIALIZABLE is really slow :).

Re: [GENERAL] Npgsql GUI problem C#.net

2007-08-29 Thread Hiroshi Saito
Hi. Please see, http://npgsql.projects.postgresql.org/exampleprograms.html This is DataGrid sample. It is very simple composition. However, Operation may be somewhat difficult at the property of VS2005. Then, ADO.NET2.0 and Npgsql are not congenial. Regards, Hiroshi Saito - Original Mess

Re: [GENERAL] PostgreSQL Conference Fall 2007

2007-08-29 Thread Stuart Cooper
> PostgreSQL.Org is having a one day technical conference in Portland, > Oregon on October 20th 2007. The conference will be held at Portland > State University, and like PDXPGDay during OSCON there will be a dinner > and party afterward. This is wrongly advertised (and dead-linked) on the homepag

Re: [GENERAL] ERROR: table row type and query-specified row type do not match

2007-08-29 Thread Tom Lane
Patryk Kordylewski <[EMAIL PROTECTED]> writes: > can someone help/explain me why i get this error when i try to make an > update on that view? It seems that something is wrong with the subselect. > http://fooby.imosnet.de/error.txt AFAICT, this works for me, so either you left something important

Re: [GENERAL] counting columns

2007-08-29 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/28/07 10:46, pere roca wrote: > hi! > > I want different users to insert data and perform different analysis which > will be inserted in an interactively created new column. The name of this > new column should follow a logic name such as: fxan

Re: [GENERAL] show connection limit?

2007-08-29 Thread Tom Lane
[EMAIL PROTECTED] writes: > Is there a way to see what the connection limit is set to for various > users? Look in pg_authid. regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your free space map set

[GENERAL] how to print a schema

2007-08-29 Thread mrodriguez
Does anybody know how to print a schema in PostgreSQL? I know you can look at one table at at time, but is there a way to print all columns and rows at once? thanks. ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] simple query runs 26 seconds

2007-08-29 Thread Andrus
> OK, so the info relevant to this query is > >> INFO: index "rid_toode_idx" now contains 1517900 row versions in 9950 >> pages >> DETAIL: 7375 index row versions were removed. >> 245 index pages have been deleted, 232 are currently reusable. > >> INFO: "rid": found 7375 removable, 1517900 nonr

[GENERAL] pg_dump.... pg_restore...how long does it take?

2007-08-29 Thread rafikoko
Hi, I've dumped my database into archive by using following command: .\pg_dump -U tad -ci -F t -f openbravo.tar openbravo. Everything seemed to be all right and the whole process was very fast. Afterwards I've got tar file which size is about 4MB. I've got also the following message after dumping:

[GENERAL] Can this function be declared IMMUTABLE?

2007-08-29 Thread beickhof
Hello, I have a question about whether I can safely declare a function IMMUTABLE. Citing the documentation under "Function Volatility Categories" in the section on "Extending SQL": It is generally unwise to select from database tables within an IMMUTABLE

[GENERAL] counting columns

2007-08-29 Thread pere roca
hi! I want different users to insert data and perform different analysis which will be inserted in an interactively created new column. The name of this new column should follow a logic name such as: fxanalysis_1 for the first user that perform the analysis called fx, fxanalysis_2 for the second

Re: [GENERAL] PGError: input out of range

2007-08-29 Thread dustov
The problem was indeed ACOS() being outside of the [-1,1] range, and this happened because it was calculating the distance between the same LAT,LONG pair (the same location) I added a WHERE L1.ID <> L2.ID to stop the reflexive calculation. Martijn van Oosterhout wrote: > > On Sat, Aug 18, 2007

[GENERAL] ERROR: table row type and query-specified row type do not match

2007-08-29 Thread Patryk Kordylewski
Hi, can someone help/explain me why i get this error when i try to make an update on that view? It seems that something is wrong with the subselect. http://fooby.imosnet.de/error.txt Thanks, Patryk ---(end of broadcast)--- TIP 1: if posting/rea

Re: [GENERAL] Creating indices on foreign keys

2007-08-29 Thread Sanjay
> I think PostgreSQL does not create indexes on foreign keys of a table, > and I have to do so explicitly. That means, wherever I am using master- > detail table, I have to create explicit indexes on the foreign key in > the detail table. Am I wrong? Refering the discussion here, I assume I am cor

Re: [GENERAL] Removing pollution from log files

2007-08-29 Thread Andrus
> That's not pollution; it's telling you you need to fix your > application to escape the backslashes differently. I havent seen that ODBC specification requires escaping strings. So this is task of ODBC driver. Andrus. ---(end of broadcast)---

[GENERAL] Creating indices on foreign keys

2007-08-29 Thread Sanjay
Hi All, I think PostgreSQL does not create indexes on foreign keys of a table, and I have to do so explicitly. That means, wherever I am using master- detail table, I have to create explicit indexes on the foreign key in the detail table. Am I wrong? thanks Sanjay ---(en

Re: [GENERAL] psql \copy command runs as a transcation?

2007-08-29 Thread Tom Lane
Ow Mun Heng <[EMAIL PROTECTED]> writes: > Does the psql's \copy command run as a transaction? Certainly. > I think it does, but > somehow when I cancel (in a script) a running import, "seems" (I can't > seem to duplicate it on the cli though) like a few lines/rows gets > inserted anyway.. Hmm.

Re: [GENERAL] Bigtime scaling of Postgresql (cluster and stuff I suppose)

2007-08-29 Thread Trent Shipley
On Monday 2007-08-27 08:04, Andrew Sullivan wrote: > On Sat, Aug 25, 2007 at 11:13:45AM -0400, Tom Lane wrote: > > In case you hadn't noticed the disconnect between these statements: > > if they have to be that close together, there *will* be a single point > > of failure. Fire in your data center

Re: [GENERAL] EXPLAIN ANALYZE not considering primary and unique indices!

2007-08-29 Thread Sanjay
Thanks a lot everybody! I got it clear. I was wrongly thinking that PostgreSQL might not be creating the indices by default. regards Sanjay ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscri

[GENERAL] Npgsql GUI problem C#.net

2007-08-29 Thread Jessie
Hi all, I'm using C#.net 2005 dealing with Npgsql. I have a very newbie question about how to use the data received from the database. I've already connected the database with the program and reading data from database works very well in the Console application. But in windows form application, I

Re: [GENERAL] autovacuum not running

2007-08-29 Thread Tom Lane
Ben <[EMAIL PROTECTED]> writes: > After some tests, it seems that autovacuum doesn't kick in from simple > inserts, as the manual says it will. You have to delete and/or update as > well. Am I misreading the manual? There's nothing to vacuum until you delete or update. You should see some auto-

[GENERAL] show connection limit?

2007-08-29 Thread Ken . Colson
I have set the connection limit of a user with the ALTER ROLE command in 8.1. Is there a way to see what the connection limit is set to for various users? Thanks, Ken

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Gregory Stark
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> "Joshua D. Drake" <[EMAIL PROTECTED]> writes: >>> Tom Lane wrote: "Joshua D. Drake" <[EMAIL PROTECTED]> writes: > SERIALIZABLE is really slow :). Say what? If anything it's probably faster than READ COMMITTED, becaus

Re: [GENERAL] autovacuum not running

2007-08-29 Thread Ben
On Tue, 28 Aug 2007, Decibel! wrote: On Tue, Aug 28, 2007 at 03:10:34PM -0700, Ben wrote: Hm, I assumed it wasn't running because pg_stat_all_tables shows the last vacuum from several weeks ago, and this is an active db. Also, I see no vacuum activity in the logs. But "show autovacuum" does sho

Re: [GENERAL] SSL and crash woes.

2007-08-29 Thread Jeff Amiel
--- Scott Marlowe <[EMAIL PROTECTED]> wrote: > > Interesting. Is it possible that either you've got 2 versions of > openssl? Maybe slony is being compiled against one, then using the > other lib, etc.? yes...I suppose it is.Solaris came with one...we installed another. hm... #

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-29 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I'm not having much luck really. I think the problem is that ANALYZE > stores reltuples as the number of live tuples, so if you delete a big > portion of a big table, then ANALYZE and then VACUUM, there's a huge > misestimation and extra index cleanup p

Re: [GENERAL] How to avoid "Seq Scans"?

2007-08-29 Thread Vincenzo Romano
On Wednesday 29 August 2007 11:20:53 Richard Huxton wrote: > Vincenzo Romano wrote: > > Hi all. > > > > In PG 8.2.4 I have a 4+M rows table like this: > > > > I'd need to write a stored function that should do the > > following: > > > > for rec in select * from t order by f2,f2 loop > > ... > > end

Re: [GENERAL] SSL and crash woes.

2007-08-29 Thread Scott Marlowe
On 8/29/07, Jeff Amiel <[EMAIL PROTECTED]> wrote: > A couple of years back (2005) we were setting up replication for the first > time (using slony) from > our production database server to a stand-by box sitting next to it and a > remote box in a DR > site. We were running FreeBSD 5.X/6.X on al

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-29 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > >> Given that the worst-case consequence is extra index vacuum passes, > >> which don't hurt that much when a table is small, maybe some smaller > >> estimate like 100 TIDs per page would be enough. Or, instead of > >> using a hard

Re: [GENERAL] SSL and crash woes.

2007-08-29 Thread Tom Lane
Jeff Amiel <[EMAIL PROTECTED]> writes: > [ SSL plus slony = crash ] Interesting --- I don't recall that that's ever been reported before. It might be best to take it up on the slony lists; I wouldn't want to speculate whether the bug is in slony or the core backend (or openssl?) but slony hackers

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane wrote: > "Joshua D. Drake" <[EMAIL PROTECTED]> writes: >> Tom Lane wrote: >>> "Joshua D. Drake" <[EMAIL PROTECTED]> writes: SERIALIZABLE is really slow :). >>> Say what? If anything it's probably faster than READ COMMITTED, because >>> i

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Tom Lane
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> "Joshua D. Drake" <[EMAIL PROTECTED]> writes: >>> SERIALIZABLE is really slow :). >> >> Say what? If anything it's probably faster than READ COMMITTED, because >> it doesn't take as many snapshots. But the difference is likely do

[GENERAL] SSL and crash woes.

2007-08-29 Thread Jeff Amiel
A couple of years back (2005) we were setting up replication for the first time (using slony) from our production database server to a stand-by box sitting next to it and a remote box in a DR site. We were running FreeBSD 5.X/6.X on all systems on Dell servers and postgres 7.4.X and then 8.0.X

Re: [GENERAL] postgresql connection string to Vb.NET

2007-08-29 Thread Owen Hartnett
At 8:49 AM -0700 8/29/07, smithveg wrote: Hi, I got a source of connection string at this page, http://www.connectionstrings.com/default.aspx?carrier=postgresql I can't test it because it seems i do not add a reference in visual

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane wrote: > "Joshua D. Drake" <[EMAIL PROTECTED]> writes: >> Ron Johnson wrote: >>> Argh!!! The RDBMS that I typically use defaults to SERIALIZABLE. > >> SERIALIZABLE is really slow :). > > Say what? If anything it's probably faster than READ

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Tom Lane
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > Ron Johnson wrote: >> Argh!!! The RDBMS that I typically use defaults to SERIALIZABLE. > SERIALIZABLE is really slow :). Say what? If anything it's probably faster than READ COMMITTED, because it doesn't take as many snapshots. But the difference

Re: ACID (was Re: [GENERAL] Reliable and fast ...)

2007-08-29 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/29/07 11:20, Joshua D. Drake wrote: > Ron Johnson wrote: >> On 08/29/07 10:40, Joshua D. Drake wrote: >>> Ron Johnson wrote: > Argh!!! The RDBMS that I typically use defaults to SERIALIZABLE. >>> SERIALIZABLE is really slow :). You should

Re: [GENERAL] postgresql connection string to Vb.NET

2007-08-29 Thread Curtis Scheer
http://www.postgresql.org/download/ lists the db drivers for a variety of languages. _ From: smithveg [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 29, 2007 10:50 AM To: pgsql-general@postgresql.org Subject: [GENERAL] postgresql connection str

Re: ACID (was Re: [GENERAL] Reliable and fast ...)

2007-08-29 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ron Johnson wrote: > On 08/29/07 10:40, Joshua D. Drake wrote: >> Ron Johnson wrote: >>> Argh!!! The RDBMS that I typically use defaults to SERIALIZABLE. >> SERIALIZABLE is really slow :). You should look into SERIALIZABLE only >> for those transacti

Re: [GENERAL] Is there a better way to do this?

2007-08-29 Thread David Fetter
On Tue, Aug 28, 2007 at 04:59:46PM -0400, Wei Weng wrote: > Hi all > > I want to implement something like the following: > > CREATE OR REPLACE FUNCTION AddDays >(TIMESTAMP WITHOUT TIME ZONE >, INT) > RETURNS TIMESTAMP WITHOUT TIME ZONE AS ' > DECLARE >time ALIAS FOR $1; >

Re: [GENERAL] postgresql connection string to Vb.NET

2007-08-29 Thread Hiroshi Saito
Hi. Please see, http://npgsql.projects.postgresql.org/ and http://psqlodbc.projects.postgresql.org/ Regards, Hiroshi Saito - Original Message - From: smithveg To: pgsql-general@postgresql.org Sent: Thursday, August 30, 2007 12:49 AM Subject: [GENERAL] postgresql connection string to V

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/29/07 10:47, Tom Lane wrote: > Ron Johnson <[EMAIL PROTECTED]> writes: >> On 08/29/07 07:27, cluster wrote: >>> Just make sure and read up about transaction isolation... in the default >>> of READ COMMITTED mode, you can sometimes see changes mad

Re: [GENERAL] Question regarding autovacuum in 8.1

2007-08-29 Thread Alvaro Herrera
Denis Gasparin wrote: > How is it possibile to check if autovacuum is running in 8.1.x? > > "Show Autovacuum" gives me "on" and also i see evidence in logs > where,autovacuum writes "LOG: autovacuum: processing database ". Then it is running. > However i have no idea of what tables the auto

Re: [GENERAL] pg_dump.... pg_restore...how long does it take?

2007-08-29 Thread Tom Lane
rafikoko <[EMAIL PROTECTED]> writes: > I've got also the following message after dumping: > pg_dump: [tar archiver] actual file length (4104361) does not match expected > (4104361) > which in fact does not make sense for me. Hmm, it looks like that code is printing the wrong variable's value. Howe

[GENERAL] Question regarding autovacuum in 8.1

2007-08-29 Thread Denis Gasparin
How is it possibile to check if autovacuum is running in 8.1.x? "Show Autovacuum" gives me "on" and also i see evidence in logs where,autovacuum writes "LOG: autovacuum: processing database ". However i have no idea of what tables the autovacuum daemon is processing because there aren't auto

[GENERAL] postgresql connection string to Vb.NET

2007-08-29 Thread smithveg
Hi, I got a source of connection string at this page, http://www.connectionstrings.com/default.aspx?carrier=postgresql I can't test it because it seems i do not add a reference in visual studio 2005. Where can i download the ODBC or .NET data provider in order to successfully connect to postgresq

ACID (was Re: [GENERAL] Reliable and fast ...)

2007-08-29 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/29/07 10:40, Joshua D. Drake wrote: > Ron Johnson wrote: >> On 08/29/07 09:34, Decibel! wrote: >>> On Wed, Aug 29, 2007 at 08:37:26AM -0500, Ron Johnson wrote: On 08/29/07 07:27, cluster wrote: > OK, thanks. But what with the second

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Tom Lane
Ron Johnson <[EMAIL PROTECTED]> writes: > On 08/29/07 07:27, cluster wrote: >> Just make sure and read up about transaction isolation... in the default >> of READ COMMITTED mode, you can sometimes see changes made by other >> transactions. > Argh!!! The RDBMS that I typically use defaults to SERI

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ron Johnson wrote: > On 08/29/07 09:34, Decibel! wrote: >> On Wed, Aug 29, 2007 at 08:37:26AM -0500, Ron Johnson wrote: >>> -BEGIN PGP SIGNED MESSAGE- >>> Hash: SHA1 >>> >>> On 08/29/07 07:27, cluster wrote: OK, thanks. But what with the s

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/29/07 09:34, Decibel! wrote: > On Wed, Aug 29, 2007 at 08:37:26AM -0500, Ron Johnson wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> On 08/29/07 07:27, cluster wrote: >>> OK, thanks. But what with the second question in which the

Re: [GENERAL] Etc/% timezones

2007-08-29 Thread Tom Lane
Naz Gassiep <[EMAIL PROTECTED]> writes: > Good thing I'm filtering them out then, else confusion would ensue. Has > anyone brought the stupidity of this to the attention of the SQL team? Is Do you really think they're unaware of that? Actually, the bug is in the POSIX definition, which is out o

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Decibel!
On Wed, Aug 29, 2007 at 08:37:26AM -0500, Ron Johnson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 08/29/07 07:27, cluster wrote: > > OK, thanks. But what with the second question in which the UPDATE is > > based on a SELECT max(...) statement on another table? How can I ensure

Re: [GENERAL] ecpg: dtime_t vs timestamp

2007-08-29 Thread Michael Meskes
On Tue, Aug 28, 2007 at 10:59:42AM -0400, Paul Tilles wrote: > We have upgraded from Version 7.4.x to Version 8.2.4. > In 7.4.x, we use the Informix compatibility functionality to use legacy > code. > Our .pgc code looks as follows: > ... This is indeed a bug. Thanks for reporting it. What hap

Re: [GENERAL] pgsql Windows installer fixed registry key

2007-08-29 Thread Dizzy
On Tuesday 28 August 2007 00:14:55 Dave Page wrote: > > The pgsql MSI installer does register a registry key but it's random > > everytime it installs (probably something MSI choses). > > No it's not random. It uses the product ID which only changes between major > versions (ie. 8.2 - 8.3) or betwe

Re: [GENERAL] Geographic High-Availability/Replication

2007-08-29 Thread Markus Schiltknecht
Hi, Decibel! wrote: But is the complete transaction information safely stored on all nodes before a commit returns? Good question. It depends very much on the group communication system and the guarantees it provides for message delivery. For certain, the information isn't safely stored on e

Re: [GENERAL] Etc/% timezones

2007-08-29 Thread Naz Gassiep
I'm pretty certain that this is a bug. Can anyone confirm? It is a bug -- in the SQL standard definition. The meaning of the sign is inverted w.r.t. the relevant POSIX (?) standard, AFAIU. Unsurprisingly, we're following the SQL standard here. Wow. Seriously, wow. Good thing I'm filter

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/29/07 07:27, cluster wrote: > OK, thanks. But what with the second question in which the UPDATE is > based on a SELECT max(...) statement on another table? How can I ensure > that no other process inserts a row between my SELECT max() and UPDATE

Re: [GENERAL] Etc/% timezones

2007-08-29 Thread Alvaro Herrera
Naz Gassiep wrote: > I'm pretty certain that this is a bug. Can anyone confirm? It is a bug -- in the SQL standard definition. The meaning of the sign is inverted w.r.t. the relevant POSIX (?) standard, AFAIU. Unsurprisingly, we're following the SQL standard here. -- Alvaro Herrera

Re: [GENERAL] Reliable and fast money transaction design

2007-08-29 Thread cluster
OK, thanks. But what with the second question in which the UPDATE is based on a SELECT max(...) statement on another table? How can I ensure that no other process inserts a row between my SELECT max() and UPDATE - making my SELECT max() invalid? A table lock could be an option but I am only in

[GENERAL] Etc/% timezones

2007-08-29 Thread Naz Gassiep
I just noticed that in the pg_timezone_names system table, the name and abbrev of the "Etc/%" timezones appear to be inverted with their utc_offset value. I never noticed before, as I filter these zones out (among others) and do not use them in my app. I was just interested as to why the sugge

[GENERAL] pg_dump.... pg_restore...how long does it take?

2007-08-29 Thread rafikoko
Hi, I've dumped my database into archive by using following command: .\pg_dump -U tad -ci -F t -f openbravo.tar openbravo. Everything seemed to be all right and the whole process was very fast. Afterwards I've got tar file which size is about 4MB. I've got also the following message after dumping:

[GENERAL] Question regarding autovacuum in 8.1

2007-08-29 Thread Denis Gasparin
How is it possibile to check if autovacuum is running in 8.1.x? "Show Autovacuum" gives me on and also i see evidence in logs where autovacuum writes "LOG: autovacuum: processing database ". However i have no idea of what tables the autovacuum daemon is processing because there aren't autova

[GENERAL] Performance issue with nested loop

2007-08-29 Thread Jens Reufsteck
Hi all, I'm having a strange performance issue with two almost similar queries, the one running as expected, the other one taking far more time. The only difference is that I have "uniid in (10)" in the normally running query and "uniid in (9,10)" in the other one. The number of rows resulting fro

Re: [GENERAL] How to avoid "Seq Scans"?

2007-08-29 Thread Martijn van Oosterhout
On Wed, Aug 29, 2007 at 11:15:21AM +0200, Vincenzo Romano wrote: > This loop is increadibly slow. Infact the friendly explain tells me > that: Is it wrong? Have you have run with seq_scan disabled to see if an index scan is actually faster? If so, then perhaps your random+pagE_cost needs adjusting

Re: [GENERAL] How to avoid "Seq Scans"?

2007-08-29 Thread A. Kretschmer
am Wed, dem 29.08.2007, um 11:15:21 +0200 mailte Vincenzo Romano folgendes: > This loop is increadibly slow. Infact the friendly explain tells me > that: > > test=# explain select * from t order by f2,f3; >QUERY PLAN > --

Re: [GENERAL] How to avoid "Seq Scans"?

2007-08-29 Thread Richard Huxton
Vincenzo Romano wrote: Hi all. In PG 8.2.4 I have a 4+M rows table like this: I'd need to write a stored function that should do the following: for rec in select * from t order by f2,f2 loop ... end loop; -> Seq Scan on t (cost=0.00..85501.38 rows=4779338 width=28) I'd like to know

[GENERAL] How to avoid "Seq Scans"?

2007-08-29 Thread Vincenzo Romano
Hi all. In PG 8.2.4 I have a 4+M rows table like this: create table t ( f1 bigint, f2 text, f3 text ); create index i_t_1 on t( f1 ); create index i_t_2 on t( f2 ); create index i_t_2 on t( f3 ); I'd need to write a stored function that should do the following: for rec in select * from t

Re: [GENERAL] Install on 32 or 64 bit Linux?

2007-08-29 Thread Hannes Dorbath
On 28.08.2007 23:21, Ralph Smith wrote: Are there any indications whether 32 or 64 bit Linux would be preferable? If you have 64bit hardware, use a 64bit OS. Running IA32 on EM64T/AMD64 is pointless and requires you to use crappy hacks such as PAE. For virtual machines, consider if OS level

Re: [GENERAL] Seeking datacenter PITR backup suggestions

2007-08-29 Thread Simon Riggs
On Tue, 2007-08-28 at 21:04 -0500, Decibel! wrote: > On Tue, Aug 28, 2007 at 09:54:23PM -0400, Tom Lane wrote: > > Perhaps the docs are not sufficiently clear on the point? > > Yeah... I think that's a big gotcha waiting to smack someone. I'd > actually make the mention so that hopefully no one

Re: [HACKERS] [GENERAL] Undetected corruption of table files

2007-08-29 Thread Florian Weimer
* Alban Hertroys: > If you have a "proper" production database server, your memory has > error checking, and your RAID controller has something of the kind > as well. To my knowledge, no readily available controller performs validation on reads (not even for RAID-1 or RAID-10, where it would be p