Re: [GENERAL] Read Access to database

2007-08-28 Thread A. Kretschmer
am Tue, dem 28.08.2007, um 10:56:38 +0530 mailte Ashish Karalkar folgendes: Hello all, I have a database abc with owner c . I want to grant only read access on this DB abc to user d. More specificaly to a schema abcs in the databse abc. Is ther any way to do so? I have more than

[GENERAL] Crashed DB and base WAL files

2007-08-28 Thread Franck Roubieu - AXCENTEO
Hello, My DB crashed without any recent backup. I only have old DB files. How can i use WAL files and restore_command to restore ? Thanks Franck R.

[GENERAL] Crashed DB and base folder files

2007-08-28 Thread Franck Roubieu - AXCENTEO
Hello, My DB crashed without any recent backup. I have old DB files. Can i use base folder files to restore ? Thanks Franck R.

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Kamil Srot
Adrian Klaver wrote: I have a question. First a little history. Right now, the people who know better than I are fairly certain Postgres is not changing things on its own and the developer is certain the CMS software is not doing schema changes. As I understand it logging has been cranked up

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Kamil Srot
Tom Lane wrote: Erik Jones [EMAIL PROTECTED] writes: Also, I'd write a simple ping script to check for the table that runs every 5 seconds or so. I had gathered that the table was being touched constantly by his app, so that it'd be immediately obvious when it had gone away. If

Re: [GENERAL] Crashed DB and base folder files

2007-08-28 Thread Richard Huxton
Franck Roubieu - AXCENTEO wrote: Hello, My DB crashed without any recent backup. What happened to cause it to crash? I have old DB files. Can i use base folder files to restore ? Yes, but it's only reliable if the file-backup was taken while the database wasn't running. I'm assuming

Re: [GENERAL] delete vs insert vs update due to primary key dups - which is better

2007-08-28 Thread Richard Huxton
Ow Mun Heng wrote: Continuining with my efforts to get similar functionality as mysql's mysqlimport --replace I want to ask for the list's opinion on which is better I would suggest #3 3. \copy to temp_table, do -- update main_table set value=t2.value from temp_table t2 where main_table.pkey

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Kamil Srot
Alvaro Herrera wrote: Adrian Klaver wrote: I have a question. First a little history. Right now, the people who know better than I are fairly certain Postgres is not changing things on its own and the developer is certain the CMS software is not doing schema changes. As I understand it

Re: [GENERAL] delete vs insert vs update due to primary key dups - which is better

2007-08-28 Thread Ow Mun Heng
On Tue, 2007-08-28 at 08:19 +0100, Richard Huxton wrote: Ow Mun Heng wrote: Continuining with my efforts to get similar functionality as mysql's mysqlimport --replace I want to ask for the list's opinion on which is better I would suggest #3 3.\copy ; update ; insert Don't forget

Re: [GENERAL] Windows Download

2007-08-28 Thread Richard Huxton
John K Masters wrote: However, on looking at the U of K page that has come up I see in the top left hand corner the words This page does not exist. You're right - there's something wrong there. I'll pass this on to the website team. As a quick solution, choose browse the download mirrors

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Martijn van Oosterhout
On Mon, Aug 27, 2007 at 05:58:26PM -0400, Andrew Sullivan wrote: On Mon, Aug 27, 2007 at 11:44:38PM +0200, Kamil Srot wrote: When this problem appeared for the first time, I had clearly the wraparound problem... I did vacuum it and partially restored the data... I don't think vacuum

Re: [GENERAL] Windows Download

2007-08-28 Thread Dave Page
John K Masters wrote: I have setup a Postgres server on Debian Etch and successfully connected to it with various *nix clients but I now have to connect a WinXP client. On accessing the Postgres site I am directed to a download page, click on the appropriate link and get automatically directed

Re: [GENERAL] LDAP service lookup

2007-08-28 Thread Albe Laurenz
Dawid Kuroczko wrote: [...] and it also would be valuable to add into pg_service.conf.sample an example ldap:// stanza, so if person opens the file, she will be enlightened. I like that idea. And a missing feature. Or rather treat it as feature request. :-) A wildcard entry. I would like

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Richard Huxton
Kamil Srot wrote: In the version used on this particular server, there is no automatic/programing way of changing the schema. Upgrades are done manually and application itself doesn't need schema changes for routine operations... In that case, you can settle the matter by making sure your

Re: [GENERAL] delete vs insert vs update due to primary key dups - which is better

2007-08-28 Thread Richard Huxton
Ow Mun Heng wrote: On Tue, 2007-08-28 at 08:19 +0100, Richard Huxton wrote: Ow Mun Heng wrote: Continuining with my efforts to get similar functionality as mysql's mysqlimport --replace I want to ask for the list's opinion on which is better I would suggest #3 3.\copy ; update ; insert

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Kamil Srot
Richard Huxton wrote: Kamil Srot wrote: In the version used on this particular server, there is no automatic/programing way of changing the schema. Upgrades are done manually and application itself doesn't need schema changes for routine operations... In that case, you can settle the matter

Re: [GENERAL] PostgreSQL vs Firebird feature comparison finished

2007-08-28 Thread Harald Armin Massa
the SQL Server 2005 Express download provides software that is suitable for application embedding or lightweight application development. I never developed more then some queries on SQL Server Express or its different names. But I had to work with some applications which used the

Re: [GENERAL] PostgreSQL vs Firebird feature comparison finished

2007-08-28 Thread Dave Page
Harald Armin Massa wrote: the SQL Server 2005 Express download provides software that is suitable for application embedding or lightweight application development. I never developed more then some queries on SQL Server Express or its different names. But I had to work

[GENERAL] One database vs. hundreds?

2007-08-28 Thread Kynn Jones
I'm hoping to get some advice on a design question I'm grappling with. I have a database now that in many respects may be regarded as an collection of a few hundred much smaller parallel databases, all having the same schema. What I mean by this is that, as far as the intended use of this

Re: [GENERAL] One database vs. hundreds?

2007-08-28 Thread Kamil Srot
Kynn Jones wrote: I'm hoping to get some advice on a design question I'm grappling with. I have a database now that in many respects may be regarded as an collection of a few hundred much smaller parallel databases, all having the same schema. What I mean by this is that, as far as the

[GENERAL] INSERT doc discrepancy

2007-08-28 Thread Kristo Kaiv
INSERT INTO table [ ( column [, ...] ) ] { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) [, ...] | query } [ RETURNING * | output_expression [ AS output_name ] [, ...] ] but it seems if i want to return the result into a record i have to use it with INTO clause in the

Re: [GENERAL] One database vs. hundreds?

2007-08-28 Thread A. Kretschmer
am Tue, dem 28.08.2007, um 8:08:36 -0400 mailte Kynn Jones folgendes: I'm hoping to get some advice on a design question I'm grappling with. I have a database now that in many respects may be regarded as an collection of a few hundred much smaller parallel databases, all having the same

[GENERAL] Indexing Foreign Key Columns

2007-08-28 Thread Josh Trutwin
I am curious if there are any rules of thumb for when to index a foreign key column? I was under the impression that it was always a good idea to do this based on the fact that you typically join through a foreign key but after reading the docs I'm not so sure it's necessary or provides any

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

2007-08-28 Thread Markus Schiltknecht
Hi, Bill Moran wrote: First off, clustering is a word that is too vague to be useful, so I'll stop using it. There's multi-master replication, where every database is read-write, then there's master-slave replication, where only one server is read-write and the rest are read-only. You can add

Re: [GENERAL] One database vs. hundreds?

2007-08-28 Thread A. Kretschmer
am Tue, dem 28.08.2007, um 14:23:00 +0200 mailte Kamil Srot folgendes: Kynn Jones wrote: I'm hoping to get some advice on a design question I'm grappling with. I have a database now that in many respects may be regarded as an collection of a few hundred much smaller parallel databases, all

Re: [GENERAL] One database vs. hundreds?

2007-08-28 Thread Kevin Kempter
On Tuesday 28 August 2007 06:32:32 A. Kretschmer wrote: am Tue, dem 28.08.2007, um 14:23:00 +0200 mailte Kamil Srot folgendes: Kynn Jones wrote: I'm hoping to get some advice on a design question I'm grappling with. I have a database now that in many respects may be regarded as an

[GENERAL] difference between function and stored procedure

2007-08-28 Thread Marcelo de Moraes Serpa
Hello list, Is there any difference between a PGSQL Function and Stored Procedure in PostgreSQL (8.2) ? If so, what difference? Is the SQL used to create a SP different from the SQL used to create a function ? Thanks in advance, Marcelo.

Re: [GENERAL] delete vs insert vs update due to primary key dups - which is better

2007-08-28 Thread Michael Glaesemann
On Aug 28, 2007, at 3:10 , Richard Huxton wrote: Ow Mun Heng wrote: less typing per insert/update statement so it'll be where a.pkey = b.pkey instead of a.key1 = b.key1 and a.key2 = b.key2 and ... up to key5 I'd still leave it alone, but it's your database. And you can use the row

Re: [GENERAL] INSERT doc discrepancy

2007-08-28 Thread Alvaro Herrera
Kristo Kaiv wrote: INSERT INTO table [ ( column [, ...] ) ] { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) [, ...] | query } [ RETURNING * | output_expression [ AS output_name ] [, ...] ] but it seems if i want to return the result into a record i have to use it

Re: [GENERAL] difference between function and stored procedure

2007-08-28 Thread Michael Glaesemann
On Aug 28, 2007, at 8:24 , Marcelo de Moraes Serpa wrote: Is there any difference between a PGSQL Function and Stored Procedure in PostgreSQL (8.2) ? No. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 6: explain

Re: [GENERAL] problem with transactions in VB.NET using npgsql

2007-08-28 Thread Owen Hartnett
At 7:05 PM -0400 8/27/07, Tom Lane wrote: Owen Hartnett [EMAIL PROTECTED] writes: I assign the transaction object to each of the commands, but it seems that some tables will get updated, even when I call rollback. Is something I'm calling secretly calling commit somewhere? Dunno anything

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

2007-08-28 Thread Bill Moran
In response to Markus Schiltknecht [EMAIL PROTECTED]: Hi, Bill Moran wrote: First off, clustering is a word that is too vague to be useful, so I'll stop using it. There's multi-master replication, where every database is read-write, then there's master-slave replication, where only

[GENERAL] Turning off atime on PostgreSQL DB volumes

2007-08-28 Thread Keaton Adams
After reading several articles on the performance drag that Linux atime has on file systems we would like to mount our DB volumes with the noatime parameter to see just what type of a performance gain we will achieve. Does PostgreSQL use atime in any way when reading/writing data? If we turn

Re: [GENERAL] difference between function and stored procedure

2007-08-28 Thread Scott Marlowe
On 8/28/07, Marcelo de Moraes Serpa [EMAIL PROTECTED] wrote: Hello list, Is there any difference between a PGSQL Function and Stored Procedure in PostgreSQL (8.2) ? If so, what difference? Is the SQL used to create a SP different from the SQL used to create a function ? Strictly speaking,

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

2007-08-28 Thread Lincoln Yeoh
At 11:48 PM 8/27/2007, Trevor Talbot wrote: On 8/27/07, Jonah H. Harris [EMAIL PROTECTED] wrote: On 8/27/07, Tom Lane [EMAIL PROTECTED] wrote: that and the lack of evidence that they'd actually gain anything I find it somewhat ironic that PostgreSQL strives to be fairly non-corruptable,

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Jeff Amiel
Kamil Srot wrote: Heh, is the pool still open? Maybe I can make at least something from it :-D Current odds Application bug: even money Application configuration issue: 2-1 Rogue cron job or other maintenance process: 4-1 Somebody messing with you (or SQL injection): 8-1 XID

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Erik Jones
On Aug 28, 2007, at 9:41 AM, Kamil Srot wrote: Jeff Amiel wrote: My entire shop has set up a betting pool on the outcome of this...so I hope you post results regardless of the outcome, Kamil. Heh, is the pool still open? Maybe I can make at least something from it :-D (in all seriousness,

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Jeff Amiel
My entire shop has set up a betting pool on the outcome of this...so I hope you post results regardless of the outcome, Kamil. (in all seriousness, we hope you find/fix the problem before things get really ugly) Kamil Srot wrote: Richard Huxton wrote: Kamil Srot wrote: In the version used

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Kamil Srot
Jeff Amiel wrote: My entire shop has set up a betting pool on the outcome of this...so I hope you post results regardless of the outcome, Kamil. Heh, is the pool still open? Maybe I can make at least something from it :-D (in all seriousness, we hope you find/fix the problem before things

Re: [GENERAL] One database vs. hundreds?

2007-08-28 Thread Kynn Jones
Thank you very much for your replies. Given the differences in the opinions expressed, I thought I would describe the database briefly. The purpose of the database is basically translation of terms. Imagine a collection of disjoint sets A, B, C, ... Now imagine that for each element of a set

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Lincoln Yeoh
At 03:15 PM 8/28/2007, Kamil Srot wrote: Andrew, Alvaro... well, sure SQL injection is possibility I cannot ignore... (and sure as dad of this application, I think it's not the case :-) ... just kidding... As even the injected SQL will be shown in the logs, so we'll know more after some time.

Re: [GENERAL] One database vs. hundreds?

2007-08-28 Thread Shane Ambler
Kynn Jones wrote: I'm hoping to get some advice on a design question I'm grappling with. I have a database now that in many respects may be regarded as an collection of a few hundred much smaller parallel databases, all having the same schema. What I mean by this is that, as far as the

[GENERAL] Reliable and fast money transaction design

2007-08-28 Thread cluster
I need a way to perform a series of money transactions (row inserts) together with some row updates in such a way that integrity is ensured and performance is high. I have two tables: ACCOUNTS ( account_id int, balance int ); TRANSACTIONS ( transaction_id int,

Re: [GENERAL] Read Access to database

2007-08-28 Thread Kevin Neufeld
This seems unnecessarily complicated. Yes, I believe you do have to grant select on every table, but you can use psql to generate the queries, then execute them. i.e. -- show only tuples /t -- output to temp script file. /o script.sql -- generate your script using pg_tables SELECT 'GRANT

[GENERAL] ecpg: dtime_t vs timestamp

2007-08-28 Thread Paul Tilles
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: #include Ice.h EXEC SQL include sqlda; EXEC SQL include sqltypes; EXEC SQL include sql3types; EXEC SQL include

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

2007-08-28 Thread Markus Schiltknecht
Hi, Bill Moran wrote: While true, I feel those applications are the exception, not the rule. Most DBs these days are the blogs and the image galleries, etc. And those don't need or want the overhead associated with synchronous replication. Uhm.. do blogs and image galleries need replication

Re: [GENERAL] PickSplit method of 2 columns ... error

2007-08-28 Thread Teodor Sigaev
Split page algorithm was rewrited for 8.2 for multicolumn indexes and API for user-defined pickSplit function was extended to has better results with index creation. But GiST can interact with old functions - and it says about this. That isn't mean some real problem or error - index will be the

[GENERAL] OT? Courier + PgSQL problem

2007-08-28 Thread Madison Kelly
Hi all, I fully acknowledge that this may be off topic, but hopefully not too much. :) I am hoping some of you have used PgSQL this way and can help as I am not on any courier mail lists. I have a problem I can't seem to figure out. I am trying to get Courier to read email over POP3

Re: [GENERAL] 8.1.10 release?

2007-08-28 Thread Alvaro Herrera
George Pavlov wrote: What's the plan for releasing the next 8.1? There hasn't been a release since April and there have been fixes. (I personally am particularly interested in implement chunking protocol for writes to the syslogger pipe because without it over 2/3 of attempts at query analysis

[GENERAL] 8.1.10 release?

2007-08-28 Thread George Pavlov
What's the plan for releasing the next 8.1? There hasn't been a release since April and there have been fixes. (I personally am particularly interested in implement chunking protocol for writes to the syslogger pipe because without it over 2/3 of attempts at query analysis fail for me). George

Re: [GENERAL] INSERT doc discrepancy

2007-08-28 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Kristo Kaiv wrote: but it seems if i want to return the result into a record i have to use it with INTO clause in the end: Ah, you are using it in plpgsql! OK, but the explanation to the discrepancy is that the second INTO is not part of the SQL

Re: [GENERAL] Indexing Foreign Key Columns

2007-08-28 Thread Tom Lane
Josh Trutwin [EMAIL PROTECTED] writes: I am curious if there are any rules of thumb for when to index a foreign key column? (You realize of course that there's already an index on the referenced column, else you wouldn't have been allowed to reference it.) You need an index on the referencing

[GENERAL] Can this function be declared IMMUTABLE?

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

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Raymond O'Donnell
On 28/08/2007 15:48, Jeff Amiel wrote: Alien or supernatural intervention: 18-1 Obscure postgresql bug nobody else has ever seen: 25-1 That's the sort of confidence in the DBMS we all like to see! :-) Ray. --- Raymond O'Donnell,

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

2007-08-28 Thread Bill Moran
In response to [EMAIL PROTECTED]: Hello, I have a question about whether I can safely declare a function IMMUTABLE. Citing the PostgreSQL documentation under Function Volatility Categories in the section on Extending SQL: It is generally unwise

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

2007-08-28 Thread Tom Lane
[EMAIL PROTECTED] writes: Well, I am considering a function that does select 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 table itself is endowed with

Re: [GENERAL] 8.1.10 release?

2007-08-28 Thread Tom Lane
George Pavlov [EMAIL PROTECTED] writes: What's the plan for releasing the next 8.1? It is on the radar screen, but core has been trying to focus on getting 8.3 ready for beta. Thankfully, we are starting to see some light at the end of that tunnel ... maybe another couple weeks.

Re: [GENERAL] Turning off atime on PostgreSQL DB volumes

2007-08-28 Thread Tom Lane
Keaton Adams [EMAIL PROTECTED] writes: After reading several articles on the performance drag that Linux atime has on file systems we would like to mount our DB volumes with the noatime parameter to see just what type of a performance gain we will achieve. Does PostgreSQL use atime in any way

Re: [GENERAL] Turning off atime on PostgreSQL DB volumes

2007-08-28 Thread Magnus Hagander
Keaton Adams wrote: After reading several articles on the performance drag that Linux atime has on file systems we would like to mount our DB volumes with the noatime parameter to see just what type of a performance gain we will achieve. Does PostgreSQL use atime in any way when

Re: [GENERAL] Turning off atime on PostgreSQL DB volumes

2007-08-28 Thread Bill Moran
In response to Keaton Adams [EMAIL PROTECTED]: After reading several articles on the performance drag that Linux atime has on file systems we would like to mount our DB volumes with the noatime parameter to see just what type of a performance gain we will achieve. Does PostgreSQL use atime

Re: [GENERAL] Turning off atime on PostgreSQL DB volumes

2007-08-28 Thread Gavin M. Roy
We use noatime on our production database without issues. On 8/28/07, Bill Moran [EMAIL PROTECTED] wrote: In response to Keaton Adams [EMAIL PROTECTED]: After reading several articles on the performance drag that Linux atime has on file systems we would like to mount our DB volumes with the

Re: [GENERAL] Seeking datacenter PITR backup suggestions

2007-08-28 Thread Steve Crawford
In general, your handling of WAL files seems fragile and error-prone Indeed. I would recommend simply using rsync to handle pushing the files. I see several advantages: 1. Distributed load - you aren't copying a full-day of files all at once. 2. Very easy to set-up - you can use it

Re: [GENERAL] Indexing Foreign Key Columns

2007-08-28 Thread Josh Trutwin
On Tue, 28 Aug 2007 13:19:32 -0400 Tom Lane [EMAIL PROTECTED] wrote: Josh Trutwin [EMAIL PROTECTED] writes: I am curious if there are any rules of thumb for when to index a foreign key column? (You realize of course that there's already an index on the referenced column, else you

Re: [GENERAL] PickSplit method of 2 columns ... error

2007-08-28 Thread Tom Lane
Teodor Sigaev [EMAIL PROTECTED] writes: Split page algorithm was rewrited for 8.2 for multicolumn indexes and API for user-defined pickSplit function was extended to has better results with index creation. But GiST can interact with old functions - and it says about this. That isn't mean

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

2007-08-28 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: [EMAIL PROTECTED] writes: Well, I am considering a function that does select 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

Re: [GENERAL] Seeking datacenter PITR backup suggestions

2007-08-28 Thread Gregory Stark
Steve Crawford [EMAIL PROTECTED] writes: 4. Much more up-to-the-minute recovery data. In your scenario, what about using cp -l (or ln) instead? Since the hard-link it is only creating a new pointer, it will be very fast and save a bunch of disk IO on your server and it doesn't appear that

Re: [GENERAL] Seeking datacenter PITR backup suggestions

2007-08-28 Thread Steve Crawford
Gregory Stark wrote: In your scenario, what about using cp -l (or ln) instead? Postgres tries to reuse WAL files. Once the archive_command completes it believes it is safe to reuse the old file without deleting it. That will do nasty things if you've used ln as your archive command.

[GENERAL] Question regarding autovacuum

2007-08-28 Thread Karl Denninger
Running 8.2.4. The following is in my postgresql.conf: # - Query/Index Statistics Collector - #stats_command_string = on update_process_title = on stats_start_collector = on # needed for block or row stats # (change requires restart)

Re: [GENERAL] Question regarding autovacuum

2007-08-28 Thread Alvaro Herrera
Karl Denninger wrote: A manual Vacuum full analyze fixes it immediately. But... .shouldn't autovacuum prevent this? Is there some way to look in a log somewhere and see if and when the autovacuum is being run - and on what? Are your FSM settings enough to keep track of the dead space you

Re: [GENERAL] PickSplit method of 2 columns ... error

2007-08-28 Thread Kevin Neufeld
Yes, thanx. This would be useful as some of our clients are getting swamped (and confused) with these messages in the log files. Cheers, Kevin Tom Lane wrote: Teodor Sigaev [EMAIL PROTECTED] writes: Split page algorithm was rewrited for 8.2 for multicolumn indexes and API for user-defined

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Jeff Amiel
I notice in the log entries for the out of memory events have no username, database name or host identifier (while regular logged events do) Does that mean anything to anybody? Aug 28 08:25:50 db-1 postgres[29019]: [ID 748848 local0.warning] [111900-1] 2007-08-28 08:25:50.081 CDT

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Alvaro Herrera
Jeff Amiel wrote: I notice in the log entries for the out of memory events have no username, database name or host identifier (while regular logged events do) Does that mean anything to anybody? Aug 28 08:25:50 db-1 postgres[29019]: [ID 748848 local0.warning] [111900-1] 2007-08-28

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Tom Lane
Jeff Amiel [EMAIL PROTECTED] writes: I notice in the log entries for the out of memory events have no username, database name or host identifier (while regular logged events do) Does that mean anything to anybody? Means they're coming from autovacuum, likely? Autovacuum probably *should*

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Jeff Amiel
--- Alvaro Herrera [EMAIL PROTECTED] wrote: 2.168.20.44 28785LOG: duration: 22606.146 ms execute unnamed: select Interesting. What's your log_line_prefix? Does it have %q somewhere? No, no %q...not quite sure what it means: stop here in non-session processes

Re: [GENERAL] Question regarding autovacuum

2007-08-28 Thread Karl Denninger
I don't know. How do I check? Karl Denninger ([EMAIL PROTECTED]) http://www.denninger.net Alvaro Herrera wrote: Karl Denninger wrote: A manual Vacuum full analyze fixes it immediately. But... .shouldn't autovacuum prevent this? Is there some way to look in a log somewhere and see

Re: [GENERAL] Question regarding autovacuum

2007-08-28 Thread Tom Lane
Karl Denninger [EMAIL PROTECTED] writes: But... .shouldn't autovacuum prevent this? Is there some way to look in a log somewhere and see if and when the autovacuum is being run - and on what? There's no log messages (at the default log verbosity anyway). But you could look into the pg_stat

Re: [GENERAL] Question regarding autovacuum

2007-08-28 Thread Steve Crawford
Karl Denninger wrote: Are your FSM settings enough to keep track of the dead space you have? I don't know. How do I check? vacuum verbose; Toward the bottom you will see something like: ... 1200 page slots are required to track all free space. Current limits are: 453600 page slots, 1000

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Erik Jones
On Aug 28, 2007, at 3:55 PM, Tom Lane wrote: Jeff Amiel [EMAIL PROTECTED] writes: I notice in the log entries for the out of memory events have no username, database name or host identifier (while regular logged events do) Does that mean anything to anybody? Means they're coming from

Re: [GENERAL] Question regarding autovacuum

2007-08-28 Thread Karl Denninger
Tom Lane wrote: Karl Denninger [EMAIL PROTECTED] writes: But... .shouldn't autovacuum prevent this? Is there some way to look in a log somewhere and see if and when the autovacuum is being run - and on what? There's no log messages (at the default log verbosity anyway). But you

Re: [GENERAL] Question regarding autovacuum

2007-08-28 Thread Karl Denninger
Steve Crawford wrote: Karl Denninger wrote: Are your FSM settings enough to keep track of the dead space you have? I don't know. How do I check? vacuum verbose; Toward the bottom you will see something like: ... 1200 page slots are required to track all free space. Current

[GENERAL] Install on 32 or 64 bit Linux?

2007-08-28 Thread Ralph Smith
Hello, We're at a crossroads here and it's time to upgrade boxes and versions of PG. This eMail query is about the first step. Are there any recommendations on whether to install onto 32 vs 64 bit Linux? We're going to be using virtual machines. Our application consists mostly of

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Marko Kreen
On 8/24/07, Jeff Amiel [EMAIL PROTECTED] wrote: Over last 2 days, have spotted 10 Out of Memory errors in postgres logs (never saw before with same app/usage patterns on tuned hardware/postgres under FreeBSD) Aug 22 18:08:24 db-1 postgres[16452]: [ID 748848 local0.warning] [6-1] 2007-08-22

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

2007-08-28 Thread Wei Weng
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; days ALIAS FOR $2; BEGIN RETURN time+days*24*3600*''1

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

2007-08-28 Thread Martijn van Oosterhout
On Tue, Aug 28, 2007 at 04:59:46PM -0400, Wei Weng wrote: Hi all I want to implement something like the following: Well, you could always implement it as SQL instead (untested): CREATE OR REPLACE FUNCTION AddDays (TIMESTAMP WITHOUT TIME ZONE , INT) RETURNS TIMESTAMP WITHOUT

Re: [GENERAL] autovacuum not running

2007-08-28 Thread Alvaro Herrera
Ben wrote: My autovacuum daemon isn't running on 8.2.4, and I'm guessing it's because I changed my unix socket directory in postgresql.conf. Is there a way I can tell autovacuum which socket file to use, or which IP to connect to? It doesn't use a socket. How do you know it's not running?

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

2007-08-28 Thread Michael Glaesemann
On Aug 28, 2007, at 15:59 , Wei Weng wrote: I don't really like this implementation. Is there a more concise way to do this? create or replace function add_days(timestamp, int) returns timestamp language sql as $body$ select $1 + $2 * interval '1 day' $body$; Note that interval '1 day' is

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

2007-08-28 Thread Osvaldo Rosario Kussama
Wei Weng escreveu: 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; days ALIAS FOR $2; BEGIN RETURN

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

2007-08-28 Thread D. Dante Lorenso
Wei Weng wrote: I want to implement something like the following: CREATE OR REPLACE FUNCTION AddDays You don't know how many seconds are in a day, so just add the days using SQL. RETURN time + (days || ' days')::INTERVAL; You don't even need to make that a function, just do that

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

2007-08-28 Thread Rodrigo De León
On 8/28/07, Wei Weng [EMAIL PROTECTED] wrote: Is there a more concise way to do this? CREATE OR REPLACE FUNCTION ADDDAYS (TIMESTAMP WITHOUT TIME ZONE, INT) RETURNS TIMESTAMP WITHOUT TIME ZONE AS ' SELECT $1+($2 * ''1 DAY''::INTERVAL) ' LANGUAGE SQL; ---(end of

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

2007-08-28 Thread Michael Glaesemann
On Aug 28, 2007, at 16:51 , Michael Glaesemann wrote: If you mean 24 hours (which you're getting with your 24 * 3600 * interval '2 second'), you could do Or, 24 * 3600 * interval '1 second', rather Michael Glaesemann grzm seespotcode net ---(end of

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

2007-08-28 Thread Michael Glaesemann
On Aug 28, 2007, at 16:55 , D. Dante Lorenso wrote: RETURN time + (days || ' days')::INTERVAL; It's bad practice to concatenate like this. Use time + days * interval '1 day' and be done with it. Michael Glaesemann grzm seespotcode net ---(end of

Re: [GENERAL] autovacuum not running

2007-08-28 Thread Ben
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 show it being on So if it is running after all, how can I track down why things aren't

Re: [GENERAL] Question regarding autovacuum

2007-08-28 Thread Scott Marlowe
On 8/28/07, Karl Denninger [EMAIL PROTECTED] wrote: Am I correct in that this number will GROW over time? Or is what I see right now (with everything running ok) all that the system will ever need? They will grow at first to accomodate your typical load of dead tuples created between

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

2007-08-28 Thread D. Dante Lorenso
Michael Glaesemann wrote: On Aug 28, 2007, at 16:55 , D. Dante Lorenso wrote: RETURN time + (days || ' days')::INTERVAL; It's bad practice to concatenate like this. Use time + days * interval '1 day' and be done with it. Why? Is this functionality expected to break in the future or has

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Alvaro Herrera
Marko Kreen escribió: I've experienced something similar. The reason turned out to be combination of overcommit=off, big maint_mem and several parallel vacuums for fast-changing tables. Seems like VACUUM allocates full maint_mem before start, whatever the actual size of the table. Hmm.

Re: [GENERAL] Question regarding autovacuum

2007-08-28 Thread Karl Denninger
Scott Marlowe wrote: On 8/28/07, Karl Denninger [EMAIL PROTECTED] wrote: Am I correct in that this number will GROW over time? Or is what I see right now (with everything running ok) all that the system will ever need? They will grow at first to accomodate your typical load of

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Alvaro Herrera
Erik Jones escribió: On Aug 28, 2007, at 4:33 PM, Marko Kreen wrote: I've experienced something similar. The reason turned out to be combination of overcommit=off, big maint_mem and several parallel vacuums for fast-changing tables. Seems like VACUUM allocates full maint_mem before start,

[GENERAL] Will Index improve the speed?

2007-08-28 Thread Yonatan Ben-Nes
Hi all, I got a table with many columns of data which got an index on one of the fields (Tsearch2 Gist). I thought that maybe if I'll create a new table with 2 fields (primary key reference to the previous table the index field from the previous table) and made the index on the index field,

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

2007-08-28 Thread Michael Glaesemann
On Aug 28, 2007, at 17:22 , D. Dante Lorenso wrote: Michael Glaesemann wrote: On Aug 28, 2007, at 16:55 , D. Dante Lorenso wrote: RETURN time + (days || ' days')::INTERVAL; It's bad practice to concatenate like this. Use time + days * interval '1 day' and be done with it. Why? Is

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

2007-08-28 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/28/07 16:21, Ralph Smith wrote: Hello, We're at a crossroads here and it's time to upgrade boxes and versions of PG. This eMail query is about the first step. Are there any recommendations on whether to install onto 32 vs 64 bit Linux?

  1   2   >