Re: [GENERAL] Replaceing records

2003-09-04 Thread Csaba Nagy
[philosophical post regarding a missing feature of Postgres] Hi all, This is exactly the problem I'm facing right now, and I found there's no good solution to this in postgres. Basically I have a complex database operation, which spans a transaction across multiple simple DB operations which can

Re: [GENERAL] Optimizer picks an ineffient plan

2003-09-04 Thread Peter Childs
On Thu, 4 Sep 2003, Tom Lane wrote: Greg Stark [EMAIL PROTECTED] writes: Tom Lane [EMAIL PROTECTED] writes: Yes, that's the real crux of the matter. Should the optimizer spend cycles on *every* query to detect cases where the user has written useless sort keys? I've got grave doubts

Re: [GENERAL] Replaceing records

2003-09-04 Thread Shridhar Daithankar
On 4 Sep 2003 at 12:17, Csaba Nagy wrote: This problem would be easily solved if the current transaction would not be automatically rolled back on the failed insert. Given this, it would be as easy as trying the insert, and if fails, do the update. That violates definition of a transaction.

Re: [GENERAL] Tomcat Connection Pool?

2003-09-04 Thread Bjorn T Johansen
On 03/09/2003 22:56 Bjørn T Johansen wrote: Oki, thx... Any ideas to what is sensible values also? (Like number of maxIdle compared to maxActive, etc..) I think sensible values are going to be very dependent on the number of requests. One way to find out might be to write a little utility

Re: [GENERAL] syntax error in eRServer.pm line 69

2003-09-04 Thread Bernd Helmle
This problem is discussed on erserver-general. There are some patches available, that solves the problem and Andrew Sullivan posted workarounds for those didn't get their tables replicated. If you're not subscribed already, you can read the archive here:

[GENERAL] tsearch2 and unexpected exists

2003-09-04 Thread Nigel J. Andrews
This will be a little vague, it was last night and I can't now do the test in that db (see below) so can't give the exact wording. I seem to remember a report a little while ago about tsearch v2 causing unexpected backend exit messages with 7.3.4 and now I'm getting similar messages

Re: [GENERAL] tsearch2 and unexpected exists

2003-09-04 Thread Teodor Sigaev
Nigel J. Andrews wrote: This will be a little vague, it was last night and I can't now do the test in that db (see below) so can't give the exact wording. I seem to remember a report a little while ago about tsearch v2 causing unexpected backend exit messages with 7.3.4 and now I'm getting

Re: [GENERAL] tsearch2 and unexpected exists

2003-09-04 Thread Nigel J. Andrews
On Thu, 4 Sep 2003, Teodor Sigaev wrote: Nigel J. Andrews wrote: I don't seem to be able to find the mailing list thread that covered pretty much this exact unexpect exit fault. So, can anyone help with a fix, explanation or link to the relevent thread please? Have you a core

Re: [GENERAL] pl/tcl trigger question

2003-09-04 Thread Jan Wieck
Jules Alberts wrote: Op 26 Aug 2003 (12:38), schreef Robert Treat [EMAIL PROTECTED]: On Tue, 2003-08-26 at 07:28, Jules Alberts wrote: Hello everyone, I'm working on a tiny trigger function that needs to ensure that all values entered in a field are lowercase'd. I can't use pl/pgsql

Re: [GENERAL] Optimizer picks an ineffient plan

2003-09-04 Thread Greg Stark
Tom Lane [EMAIL PROTECTED] writes: Um ... I *am* an optimizer-geek. That explains so much :) I stand by my comment that there's a tradeoff between the potential gain from an optimization and the time spent to find it. Well there are always tradoffs in engineering. I'm just trying to push

Re: [GENERAL] More than 1024 connections from the same c-backend

2003-09-04 Thread Tom Lane
Andreas Muck [EMAIL PROTECTED] writes: We have an application running on Linux (SuSE 7.2, kernel 2.4.16) that opens lots of connections to a Postgres database and occasionaly dies with segfault. The program seems to crash when it returns from pqWaitTimed(). As pqWaitTimed uses select() to

[GENERAL] Activate Index

2003-09-04 Thread Edwin Quijada
Hi!! This is my first post to the list. I have a problem. I have a table with a two index , int4, but when I do a search using the field indexed but when I applied an explain to the query it says Seq Scan , I mean , that it doesnot use the index. I cant use the cast field::int4 because I use

Re: [GENERAL] postmaster crashing

2003-09-04 Thread psql-mail
From: Tom Lane [EMAIL PROTECTED] [EMAIL PROTECTED] writes: How do i get the core files to examine? There never seem to be any produced, even outside the debuggers. Most likely you have launched the postmaster under ulimit -c 0, which prevents core dumps. This seems to be the

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Josué Maldonado
Hi Tom, Tom Lane wrote: =?ISO-8859-1?Q?Josu=E9_Maldonado?= [EMAIL PROTECTED] writes: Noticed that the loop does not go through all fields: Hard to believe. Could you give us a complete example, not a partial one? This is the code in the trigger function: -- Function: public.audit_log() --

[GENERAL] IP from conexion

2003-09-04 Thread Edwin Quijada
Hi [EMAIL PROTECTED] There is a something way to know which are the IP from conexcion to Postgres since plPgsql something like CURRENT_IP *---* *-Edwin Quijada *-Developer DataBase *-JQ Microsistemas *-809-747-2787 * Si deseas lograr cosas

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Tom Lane
=?ISO-8859-1?Q?Josu=E9_Maldonado?= [EMAIL PROTECTED] writes: Tom Lane wrote: Hard to believe. Could you give us a complete example, not a partial one? This is the code in the trigger function: I tried this with a table created like so: regression=# create table tinv ( regression(# f1 int,

[GENERAL] postmaster processes

2003-09-04 Thread Andy Harrison
-BEGIN PGP SIGNED MESSAGE- Could anyone explain about the max_connections in postgres? We ran into the connection limit on one of our production servers. One reason is that we have more apps that use postgres running on it (RT3 and Webcollab were added not long ago). Webcollab, for

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Josué Maldonado
Tom, This is my table definition: -- Table: public.tinv -- DROP TABLE public.tinv; CREATE TABLE public.tinv ( dep_codigo varchar(6) NOT NULL, dep_nombre varchar(35), dep_cantid int4, dep_fecadq date, dep_vidaut int4, dep_pordep int4, dep_valdep float4, dep_acumul float4,

Re: [GENERAL] Activate Index

2003-09-04 Thread scott.marlowe
What query are you running? If you run select * from indexed_table you'll get a seq scan because you're hitting every row. If you're doing select * from indexed_table where indexed_field=1 you should get an index scan. Anything in between the query planner will decide. Unlike some older

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Alvaro Herrera Munoz
On Thu, Sep 04, 2003 at 09:01:08AM -0600, Josu? Maldonado wrote: Tom, This is my table definition: [etc] It would help if you send the complete example, including the part where you actually drop a column from the table. -- Alvaro Herrera ([EMAIL PROTECTED]) La victoria es para quien se

Re: [GENERAL] adding SERIAL to a table

2003-09-04 Thread scott.marlowe
On Mon, 1 Sep 2003, Tom Lane wrote: Claudio Lapidus [EMAIL PROTECTED] writes: So? Is there a way to add the sequence to an existing table? Sure. You have to break the SERIAL down to its component parts though. Something like CREATE SEQUENCE seq; ALTER TABLE tab ADD COLUMN

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Tom Lane
Alvaro Herrera Munoz [EMAIL PROTECTED] writes: It would help if you send the complete example, including the part where you actually drop a column from the table. Oh, I forgot about that part (should read the Subject: line again ;-)). I do see a failure after dropping a column. I've applied

Re: [GENERAL] postmaster crashing

2003-09-04 Thread psql-mail
[EMAIL PROTECTED] writes: I have set ulimit -c unlimited as you sugested, i then copied postmaster to /home/postgres and ran it as postgres from there... but still no core files. Where should they appear? In $PGDATA/base/yourdbnumber/core (under some OSes the file name might be core

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Josué Maldonado
Alvaro, Actually I build a new table from the old one, so the table in metion is a new table with the same structure as before, the way I droped the column was right click on it from pgadmin III then delete, why should that matter? Thanks Alvaro Herrera Munoz wrote: On Thu, Sep 04, 2003 at

Re: [GENERAL] postmaster crashing

2003-09-04 Thread psql-mail
First - apologies for the stuff about i don't understand why there's only one core file, i now have a post-it note now saying ulimit gets reset at reboot (i assume thats what happened). So please find below a potentially more useful core file gdb output: Core was generated by `postgres: mat

Re: [GENERAL] Replaceing records

2003-09-04 Thread Greg Stark
Harald Fuchs [EMAIL PROTECTED] writes: You can't. The only thing MySQL has to offer is Actually I found two things related to this: http://www.mysql.com/doc/en/INSERT.html http://www.mysql.com/doc/en/REPLACE.html You can do INSERT INTO tab (...) VALUES (...) ON DUPLICATE KEY UPDATE

Re: [GENERAL] postmaster crashing

2003-09-04 Thread Tom Lane
[EMAIL PROTECTED] writes: #0 SN_create_env (S_size=0, I_size=2, B_size=1) at api.c:6 6 z-p = create_s(); Hm. Is it possible you're running out of memory? If the crash is right there, and not inside create_s(), it seems like a null return from calloc is the only explanation. This

Re: [GENERAL] NFS performance tuning

2003-09-04 Thread scott.marlowe
On Sun, 31 Aug 2003, Jefim M wrote: I have the following setup for my PostgreSQL box: 4GB Ram Dual CPU Redhat 7.3 with 2.4.20-18.7smp kernel 2 network cards - one is dedicated to internal traffic to the NetApp filer and other is used for other traffic and all the Postgres database

Re: [GENERAL] Index not being used ?

2003-09-04 Thread Carlos G Mendioroz
Great! Many thanks. Casting the type did the trick. Even though it is somehow clear now, I don't see why the type is (can) not (be) inferred from the field type. -- Carlos G Mendioroz [EMAIL PROTECTED] LW7 EQI Argentina ---(end of broadcast)---

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Ian Harding
It seems to work for me... create table foobar ( col1varchar, col2varchar) ; create function testfunc() returns trigger language pltcl as ' foreach id [array names NEW] { elog NOTICE $NEW($id) } '; create trigger testtrig after insert or update on foobar for each row

Re: [GENERAL] Optimizer picks an ineffient plan

2003-09-04 Thread Bupp Phillips
Well, it's unfortunate that you feel that way, because SQL Server handles it correctly. Tom Lane [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Greg Stark [EMAIL PROTECTED] writes: Bupp Phillips [EMAIL PROTECTED] writes: select * from customer order by customer_id, first_name;

[GENERAL] searching archives should be a weeeee bit faster ...

2003-09-04 Thread Marc G. Fournier
I spent this aft enabling debugging on the postmaster side, and determined that there was a critical index missing on one of the tables ... there was no index on the url.rec_id field, so a query that looks like: SELECT rec_id, site_id, pop_rank FROM url WHERE rec_id IN

Re: [GENERAL] pg_autovacuum

2003-09-04 Thread Adam Kavan
At 02:25 PM 9/4/03 -0400, Jan Wieck wrote: H ... would need to take a look at the code ... but a wild guess would be the communication between the backends and the collector daemon. I'm not sure if the UDP crap^H^H^H^Hstuff I used in there is IPV6 safe. What version of PostgreSQL was that? On

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Jan Wieck
The arrays NEW and OLD only contain entries for attributes in the respective rows that are not NULL. The list $TG_relatts contains a list of all column names of the triggering relation with a leading empty element (to make the index in that list reflect pg_attribute.attnum). Jan [EMAIL

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Jan Wieck
close the connection and reconnect to get a fresh backend that doesn't cache anything. Jan Josué Maldonado wrote: Hello list, The TCL trigger that uses NEW and OLD arrays failed after after I removed a unused column, now I got this error: pltcl: Cache lookup for attribute

Re: [GENERAL] Pass parameters to a TCL function

2003-09-04 Thread Jan Wieck
Josué Maldonado wrote: I'm sorry, found my mistake, the way I'm calling the function is wrong it should be audit_log ('xtable','internal'), it works. Hmmm, that should not work. The function should be declared taking no arguments and you yet find the arguments from the CREATE TRIGGER in the

[GENERAL] Backup?

2003-09-04 Thread Bjørn T Johansen
Should one use pg_dumpall to backup the database or is it more practical to just copy the data directory? Regards, BTJ -- --- Bjrn T Johansen (BSc,MNIF) Executive Manager [EMAIL PROTECTED]

Re: [GENERAL] descending Indexes

2003-09-04 Thread Stephan Szabo
On Thu, 4 Sep 2003, Bupp Phillips wrote: I can't find a way to create descending Indexes in PG. Is this possible? If so, can you point me in the right direction? If not, can I request this to be an enhancement? You can do it, but it's a bit difficult. You need to make an operator class for

Re: [GENERAL] Replaceing records

2003-09-04 Thread Stephan Szabo
On Thu, 4 Sep 2003, Richard Ellis wrote: On Thu, Sep 04, 2003 at 12:17:35PM +0200, Csaba Nagy wrote: [philosophical post regarding a missing feature of Postgres] I found there's no way to avoid failed inserts because of unique constraint violations, causing automatic roll-back of the

Re: [GENERAL] pg_autovacuum

2003-09-04 Thread Jan Wieck
Adam Kavan wrote: At 10:48 AM 9/4/03 -0400, Matthew T. O'Connor wrote: On Thu, 2003-09-04 at 09:01, Jan Wieck wrote: Do the stats_* options appear twice in the config file? If that isn't the case, the only possible problem left I can think of is that you're running on a platform where no

Re: [GENERAL] Optimizer picks an ineffient plan

2003-09-04 Thread Stephan Szabo
On Wed, 3 Sep 2003, Bupp Phillips wrote: Well, it's unfortunate that you feel that way, because SQL Server handles it correctly. For some definition of correctly. If you're in a system which gets penalized .001 seconds for each query planning that uses a multi-column order by and you do 100

Re: [GENERAL] TCL trigger doesn't work after deleting a column

2003-09-04 Thread Josué Maldonado
Hi Jan, You are right, that's why the loop doesn't goes through all the columns. Thanks. Jan Wieck wrote: The arrays NEW and OLD only contain entries for attributes in the respective rows that are not NULL. The list $TG_relatts contains a list of all column names of the triggering relation

Re: [GENERAL] Replaceing records

2003-09-04 Thread Jonathan Bartlett
However, that doesn't cover the case where you want to update the record if it already exists. Jon insert into test (a, b, c, d) (select 1, 2, 3, 4 where not exists (select 1 from test where a=1 and b=2 and c=3 and d=4) ); If your table contains a=1, b=2, c=3, and d=4, nothing will

Re: [GENERAL] how to call a TCL function from within a plpgsql trigger?

2003-09-04 Thread Jan Wieck
Ian Harding wrote: A tcl function is just like any other, you can call it from within a plpgsql trigger function in the same way you would call a built-in, or any other function. Having said that, I am not sure what the exact plpgsql options are besides SELECT myfunction(' 'foo' ', ' 'bar'

Re: [GENERAL] searching archives should be a weeeee bit faster ...

2003-09-04 Thread Sean Chittenden
Is index a stop word in the archives? It doesn't seem to return any results when typing in index with anything (ex: index correlation). FWIW, just a data point. -sc -- Sean Chittenden ---(end of broadcast)--- TIP 8: explain analyze is your

Re: [GENERAL] Activate Index

2003-09-04 Thread Edwin Quijada
ok! U can tell me about the best setup and performance? and best parameters to setup I am so newbie ? I am using Postgres to emigrate a system in 4D Server to PgSql With Delphi for insurance company. My server is Pentium IV 2.0 Ghz , 1 GB Ram, 40 GB HD 7200RPM? Now I wanna know what is the best

Re: [GENERAL] Backup?

2003-09-04 Thread Vivek Khera
BTJ == Bjørn T Johansen Bj writes: BTJ Should one use pg_dumpall to backup the database or is it more yes, or pg_dump specific databases. BTJ practical to just copy the data directory? this would do you no good, since the files are not necessarily in a consistent state when you copy many of

Re: [GENERAL] Backup?

2003-09-04 Thread Doug McNaught
Bjørn T Johansen [EMAIL PROTECTED] writes: Should one use pg_dumpall to backup the database or is it more practical to just copy the data directory? The data directory will not be consistent unless the server is stopped. pg_dumpall works well, produces a consistent backup and is easily

Re: [GENERAL] is it possible to do this? have a subselect that

2003-09-04 Thread DeJuan Jackson
So I have a query in which some of the select values are subqueries. The subqueries are aggregates so I don't want to turn this into a join, it would become too complex and postgres would have trouble optimizing things. So my question is, is there some way to have a subselect return multiple

Re: [GENERAL] Activate Index

2003-09-04 Thread Ron Johnson
On Thu, 2003-09-04 at 14:08, Edwin Quijada wrote: ok! U can tell me about the best setup and performance? and best parameters to setup I am so newbie ? I am using Postgres to emigrate a system in 4D Server to PgSql With Delphi for insurance company. My server is Pentium IV 2.0 Ghz , 1 GB

Re: [GENERAL] Replaceing records

2003-09-04 Thread Richard Ellis
On Thu, Sep 04, 2003 at 12:29:17PM -0700, Stephan Szabo wrote: On Thu, 4 Sep 2003, Richard Ellis wrote: On Thu, Sep 04, 2003 at 12:17:35PM +0200, Csaba Nagy wrote: [philosophical post regarding a missing feature of Postgres] I found there's no way to avoid failed inserts because of

Re: [GENERAL] Backup?

2003-09-04 Thread Ron Johnson
On Thu, 2003-09-04 at 15:40, Doug McNaught wrote: Bjørn T Johansen [EMAIL PROTECTED] writes: Should one use pg_dumpall to backup the database or is it more practical to just copy the data directory? The data directory will not be consistent unless the server is stopped. pg_dumpall

Re: [GENERAL] Output from PLPGSQL

2003-09-04 Thread Thomas Kellerer
Richard Huxton schrieb: On Wednesday 03 September 2003 12:19, Amin Schoeib wrote: Hi, How can I make textoutput (for example for tracing the code) in PLPGSQL. In Oracle you can do that using dbms.output.put_line RAISE NOTICE ''My counter is % with total %'',i,run_tot; Double-quoted string as

Re: [GENERAL] Activate Index

2003-09-04 Thread scott.marlowe
You want this document: http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html great article on performance tuning postgresql. After reading it and digesting all you can, you should have a noticeably faster machine. On Thu, 4 Sep 2003, Edwin Quijada wrote: ok! U can tell me about the

Re: [GENERAL] searching archives should be a weeeee bit faster ...

2003-09-04 Thread Marc G. Fournier
yes it is/was ...I've just removed it from the list of stop words, but am not going to force a re-index of 250k URLs ;( So, any new index'ng will pull in index as a valid search word, and when the current URLs expire/re-index,they will get pulled in then also ... On Thu, 4 Sep 2003, Sean

Re: [GENERAL] searching archives should be a weeeee bit faster ...

2003-09-04 Thread Sean Chittenden
yes it is/was ...I've just removed it from the list of stop words, but am not going to force a re-index of 250k URLs ;( So, any new index'ng will pull in index as a valid search word, and when the current URLs expire/re-index,they will get pulled in then also ... Hrm... if I search for

Re: [GENERAL] searching archives should be a weeeee bit faster ...

2003-09-04 Thread Marc G. Fournier
On Thu, 4 Sep 2003, Sean Chittenden wrote: yes it is/was ...I've just removed it from the list of stop words, but am not going to force a re-index of 250k URLs ;( So, any new index'ng will pull in index as a valid search word, and when the current URLs expire/re-index,they will get

Re: [GENERAL] descending Indexes

2003-09-04 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: On Thu, 4 Sep 2003, Bupp Phillips wrote: I can't find a way to create descending Indexes in PG. Is this possible? You can do it, but it's a bit difficult. Do you really *need* a descending index? In most cases a backwards scan on a regular index gets

Re: [GENERAL] Replaceing records

2003-09-04 Thread Jan Wieck
Whatever you guy's try or suggest, it's doomed to suffer. The whole problem stems from using a non-standard feature. And in my opinion MySQL's REPLACE INTO is less a feature or extension to the standard than more another stupid and lesser thought through addition of apparently speed gaining

Re: [GENERAL] Optimizer picks an ineffient plan

2003-09-04 Thread Greg Stark
Stephan Szabo [EMAIL PROTECTED] writes: On Wed, 3 Sep 2003, Bupp Phillips wrote: Well, it's unfortunate that you feel that way, because SQL Server handles it correctly. For some definition of correctly. If you're in a system which gets penalized .001 seconds for each query planning

Re: [GENERAL] Replaceing records

2003-09-04 Thread Greg Stark
Richard Ellis [EMAIL PROTECTED] writes: True, if the row does not already exist. But in that situation, because of the unique constraint premise in the original quote, there is always going to be at least one failed transaction. So the battle is already lost before it's even begun. Well,

Re: [GENERAL] [HACKERS] tablelevel and rowlevel locks

2003-09-04 Thread Alvaro Herrera Munoz
On Thu, Sep 04, 2003 at 11:21:05AM -0700, Jenny - wrote: I think the locks would actually by represented by PROCLOCK structures. The LOCK structures are for lockable objects, not for actual locks. Well,from what i understand, PROCLOCK stores the TransactionID and the LOCK its holding lock

Re: [GENERAL] [HACKERS] tablelevel and rowlevel locks

2003-09-04 Thread Tom Lane
Alvaro Herrera Munoz [EMAIL PROTECTED] writes: Anyway, I think the LOCK structure represents something that can be locked. Right. The PROCLOCK struct represents that some process is holding a lock on said object. IIRC, a PROCLOCK is created as soon as some backend tries to lock some lockable

Re: [GENERAL] [HACKERS] Decent VACUUM (was: Buglist)

2003-09-04 Thread Bruce Momjian
Manfred Koizar wrote: [ still brainstorming ... ] On Thu, 21 Aug 2003 17:16:50 -0400, Tom Lane [EMAIL PROTECTED] wrote: Whenever a backend encounters a dead tuple it inserts a reference to its page into the RSM. This assumes that backends will visit dead tuples with significant

Re: [HACKERS] [GENERAL] Buglist

2003-09-04 Thread Bruce Momjian
Jan Wieck wrote: Tom Lane wrote: Jan Wieck [EMAIL PROTECTED] writes: Okay, my proposal would be to have a VACUUM mode where it tells the buffer manager to only return a page if it is already in memory, and some not cached if it would have to read it from disk, and simply skip the

[GENERAL] tablelevel and rowlevel locks

2003-09-04 Thread Jenny -
I am working on a project that involves displaying locking information about each lock taken, whether it be a row level or table leve llock. When dealing with struct LOCK (src/include/storage) i have noticed that postgreSQL creates a single LOCK struct for each table in the db. Like if i