[GENERAL] Sorting, when values are equal....

2004-10-25 Thread Net Virtual Mailing Lists
Hello, If I do something like: SELECT * FROM sometable ORDER BY somerow DESC LIMIT 1 OFFSET 2; .. and there are multiple rows in sometable where somerow is identical, am I assured that the values will always come back in the same order? . Or do I need to ensure that a second sort (such as

Re: [GENERAL] FKs and deadlocks

2004-10-25 Thread Philippe Lang
Hello, I got a deadlock in my database this morning. This time it happened in an UPDATE, but sometimes it's in an INSERT, or during a transaction too. Here is what I could gather before killing the offending processes: ps -afx: 7075 ?? I 0:00.72 postmaster: jldousse groupefpdb

Re: [GENERAL] Sorting, when values are equal....

2004-10-25 Thread Martijn van Oosterhout
On Mon, Oct 25, 2004 at 04:45:15AM -0700, Net Virtual Mailing Lists wrote: Hello, If I do something like: SELECT * FROM sometable ORDER BY somerow DESC LIMIT 1 OFFSET 2; .. and there are multiple rows in sometable where somerow is identical, am I assured that the values will always

[GENERAL] How to connect with postmaster through TCP socket

2004-10-25 Thread Deepa K
Hi, I am using postgresql 7.1.3 in RedHatLinux 7.2. Can anyone tell me how to connect with postmaster through TCP socket (it is started with -i option) using libpq from an external application. (written in C) -- regards, Deepa K ---(end of

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Thomas Hallgren
Stephan Szabo wrote: It's enabled in large part for backwards compatibility. There's a runtime option that controls the behavior (add_missing_from). IMHO, it would be a more natural choice to have the add_missing_from disabled by default. Why would anyone *ever* want faulty SQL being

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Steven Klassen
* Thomas Hallgren [EMAIL PROTECTED] [2004-10-25 15:52:20 +0200]: IMHO, it would be a more natural choice to have the add_missing_from disabled by default. Why would anyone *ever* want faulty SQL being magically patched up by the dbms? That assumes that developers will implement queries in

Re: [GENERAL] FKs and deadlocks

2004-10-25 Thread Tom Lane
Philippe Lang [EMAIL PROTECTED] writes: I got a deadlock in my database this morning. There is no deadlock here. The ungranted rows in pg_locks all point to the transaction ID 6489299, which belongs to PID 11346, which is this one: 11346 ?? R236:43.23 postmaster: jlroubaty groupefpdb

[GENERAL]

2004-10-25 Thread Ryan Richards
unsubscribe [EMAIL PROTECTED] unsubscribe ryan richards ___ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com ---(end of broadcast)--- TIP 4: Don't 'kill

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Stephan Szabo
On Mon, 25 Oct 2004, Thomas Hallgren wrote: Stephan Szabo wrote: It's enabled in large part for backwards compatibility. There's a runtime option that controls the behavior (add_missing_from). IMHO, it would be a more natural choice to have the add_missing_from disabled by default.

[GENERAL] PgSQL MVCC vs MySQL InnoDB

2004-10-25 Thread nd02tsk
Hello Harrison Fisk from MySQL claims in this thread: http://forums.mysql.com/read.php?35,3981,4245#msg-4245 That there are no major differences between InnoDB and MVCC concurrency. Is this true? Thank you. Tim ---(end of broadcast)--- TIP 3:

Re: [GENERAL] Sorting, when values are equal....

2004-10-25 Thread Peter Eisentraut
Net Virtual Mailing Lists wrote: If I do something like: SELECT * FROM sometable ORDER BY somerow DESC LIMIT 1 OFFSET 2; .. and there are multiple rows in sometable where somerow is identical, am I assured that the values will always come back in the same order? . No. Or do I need to

Re: [GENERAL] how to port Oracle database to PostgreSQL?

2004-10-25 Thread Vassilev, Lubomir G.
Thanks for your reply, however as I am a total newbie around here, I've no clue how to get to postgresql-x.y.z/contrib. I looked on the main page but couldn't find it. -Original Message- From: Scott Marlowe [mailto:[EMAIL PROTECTED] Sent: Saturday, October 23, 2004 7:10 PM To: Vassilev,

Re: [GENERAL] FKs and deadlocks

2004-10-25 Thread Philippe Lang
Thanks a lot Tom. One more question: i'm surprised there are so many ExclusiveLocks when displaying pg_lock: 33044 32920 11439 RowExclusiveLockt 6514392 14385 ExclusiveLock t 6495858 11439 ExclusiveLock t ...etc... I found in the

Re: [GENERAL] FKs and deadlocks

2004-10-25 Thread Alvaro Herrera
On Mon, Oct 25, 2004 at 05:56:04PM +0200, Philippe Lang wrote: One more question: i'm surprised there are so many ExclusiveLocks when displaying pg_lock: 33044 32920 11439 RowExclusiveLockt 6514392 14385 ExclusiveLock t 6495858 11439

Re: [GENERAL] FKs and deadlocks

2004-10-25 Thread Tom Lane
Philippe Lang [EMAIL PROTECTED] writes: One more question: i'm surprised there are so many ExclusiveLocks when displaying pg_lock: 6514392 14385 ExclusiveLock t 6495858 11439 ExclusiveLock t ...etc... Those are the transaction ID locks. I found in the

Re: [GENERAL] PgSQL MVCC vs MySQL InnoDB

2004-10-25 Thread Jan Wieck
On 10/25/2004 11:53 AM, [EMAIL PROTECTED] wrote: Hello Harrison Fisk from MySQL claims in this thread: http://forums.mysql.com/read.php?35,3981,4245#msg-4245 That there are no major differences between InnoDB and MVCC concurrency. Is this true? From a functional point of view, the two appear to do

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Steven Klassen
* Thomas Hallgren [EMAIL PROTECTED] [2004-10-25 19:06:40 +0200]: I don't see how that makes a difference really. /me notes the timestamp on his post and vows never to post before 8am again. -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Thomas Hallgren
Stephan, In general, when we add a backwards compatibility option, we give a couple of versions before the default is changed. Perhaps the 8.0 would be a perfect time since it's a change of the major number. In addition, until we have a form of delete which allows a from list, there are

[GENERAL] Arrays, placeholders, and column types

2004-10-25 Thread Dan Sugalski
I'm running into some problems with arrays in my SQL which're giving me fits. I've got some SQL statements that I'm issuing from my app using the PQexecParams() C call. All the parameters are passed in as literal string parameters (that is, the paramTypes array entry for each placeholder is set

[GENERAL] The reasoning behind having several features outside of source?

2004-10-25 Thread nd02tsk
Hello Why is it that PostgreSQL chooses to have features like replication, fulltext indexing and GIS maintained by others outside of the sourcetree? I appreciate any answers. Thank you. Tim ---(end of broadcast)--- TIP 6: Have you searched

Re: [GENERAL] The reasoning behind having several features outside

2004-10-25 Thread Joshua D. Drake
[EMAIL PROTECTED] wrote: Hello Why is it that PostgreSQL chooses to have features like replication, Well this is because there are multiple versions of replication and each has pros and cons. The community does not wish to endorse any of them. fulltext indexing and GIS maintained by others

Re: [GENERAL] Arrays, placeholders, and column types

2004-10-25 Thread Tom Lane
Dan Sugalski [EMAIL PROTECTED] writes: I've got some SQL statements that I'm issuing from my app using the PQexecParams() C call. All the parameters are passed in as literal string parameters (that is, the paramTypes array entry for each placeholder is set to 0) letting the engine convert.

Re: [GENERAL] The reasoning behind having several features outside

2004-10-25 Thread Jan Wieck
On 10/25/2004 2:19 PM, [EMAIL PROTECTED] wrote: Hello Why is it that PostgreSQL chooses to have features like replication, fulltext indexing and GIS maintained by others outside of the sourcetree? Because those are very diverse features. Replication especially, which is a bunch of different

Re: [GENERAL] The reasoning behind having several features outside of source?

2004-10-25 Thread Lamar Owen
On Monday 25 October 2004 14:19, [EMAIL PROTECTED] wrote: Why is it that PostgreSQL chooses to have features like replication, fulltext indexing and GIS maintained by others outside of the sourcetree? I'll make the attempt to answer best I can. PostgreSQL's architecture is very open and highly

Re: [GENERAL] The reasoning behind having several features outside

2004-10-25 Thread Marc G. Fournier
On Mon, 25 Oct 2004 [EMAIL PROTECTED] wrote: Hello Why is it that PostgreSQL chooses to have features like replication, fulltext indexing and GIS maintained by others outside of the sourcetree? well, in the case of replication, there are about a half dozen replication solutions currently out

Re: [GENERAL] PgSQL MVCC vs MySQL InnoDB

2004-10-25 Thread Andrew Sullivan
On Mon, Oct 25, 2004 at 01:15:33PM -0400, Jan Wieck wrote: On 10/25/2004 11:53 AM, [EMAIL PROTECTED] wrote: Is this true? From a functional point of view, the two appear to do the same thing. Well, except for one difference. InnoDB will allow you refer to tables not controlled by the

Re: [GENERAL] The reasoning behind having several features outside of source?

2004-10-25 Thread Andrew Sullivan
On Mon, Oct 25, 2004 at 08:19:20PM +0200, [EMAIL PROTECTED] wrote: Hello Why is it that PostgreSQL chooses to have features like replication, fulltext indexing and GIS maintained by others outside of the sourcetree? I can tell you for sure that the replication systems are aimed at different

Re: [GENERAL] Arrays, placeholders, and column types

2004-10-25 Thread Dan Sugalski
At 2:37 PM -0400 10/25/04, Tom Lane wrote: Dan Sugalski [EMAIL PROTECTED] writes: I've got some SQL statements that I'm issuing from my app using the PQexecParams() C call. All the parameters are passed in as literal string parameters (that is, the paramTypes array entry for each placeholder

[GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Naeem Bari
Hi, I am using postgres 7.4.5 on Redhat Enterprise Linux 3. My background is really on Oracle, and I am porting a largish database over to postgres. Here is my problem: On oracle, I had a table with an on update or delete trigger that copied the current row out to an audit

Re: [GENERAL] Bug or stupidity

2004-10-25 Thread Mike Mascari
Thomas Hallgren wrote: Steven, That assumes that developers will implement queries in their code without testing them. Unfortunately, that's probably not too far from reality. I've thought of it as a nice debugging feature while I'm trying to hammer out a complicated query for the first

Re: [GENERAL] combining two queries?

2004-10-25 Thread Jeffrey Melloy
If you want to return rows with zeros, you may need to do something like this: select b.name as viewer, count(viewerid) from xenons b left join viewer_movies a on (b.id = a.viewerid) group by b.name Eddy Macnaghten wrote: select b.name as viewer, count(*) from viewer_movies a, xenons b where

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Franco Bruno Borghesi
I've made a test case, and setting the trigger BEFORE DELETE doesn't delete the rows from the table (but it does execute the trigger, and it does insert the rows in the audit table), I dont' know why . Anyway, setting the trigger AFTER DELETE works ok. On Mon, 2004-10-25 at 15:56, Naeem Bari

Re: [GENERAL] PgSQL MVCC vs MySQL InnoDB

2004-10-25 Thread Jan Wieck
On 10/25/2004 2:42 PM, Andrew Sullivan wrote: On Mon, Oct 25, 2004 at 01:15:33PM -0400, Jan Wieck wrote: On 10/25/2004 11:53 AM, [EMAIL PROTECTED] wrote: Is this true? From a functional point of view, the two appear to do the same thing. Well, except for one difference. InnoDB will allow you

Re: [GENERAL] The reasoning behind having several features outside

2004-10-25 Thread Jeff Davis
Other people have answered, but I'd like to add: It makes it much faster to fix bugs and improve features in the projects outside of the source tree. If replication has a bug, you don't want to wait for the next point release, you want a fix *now*. PostgreSQL is a big project, and can't make new

Re: [GENERAL] Arrays, placeholders, and column types

2004-10-25 Thread Tom Lane
Dan Sugalski [EMAIL PROTECTED] writes: At 2:37 PM -0400 10/25/04, Tom Lane wrote: What you'll need to do is specify at least one of the array elements to be numeric, either via paramTypes or with a cast in the SQL command: INSERT INTO foo (bar, baz, xyzzy) VALUES ($1, $2, ARRAY[$3::numeric,

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Jan Wieck
On 10/25/2004 2:56 PM, Naeem Bari wrote: Hi, I am using postgres 7.4.5 on Redhat Enterprise Linux 3. My background is really on Oracle, and I am porting a largish database over to postgres. Here is my problem: On oracle, I had a table with an on update or delete trigger that copied the

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Tom Lane
Naeem Bari [EMAIL PROTECTED] writes: CREATE OR REPLACE FUNCTION public.func_job_status_upd() RETURNS trigger AS ' begin insert into x_job_status values ( OLD.job_id, OLD.job_status_type_id, OLD.status_date, OLD.notes, OLD.edit_person_id, OLD.edit_date); return new; end; '

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Jan Wieck
On 10/25/2004 3:33 PM, Franco Bruno Borghesi wrote: I've made a test case, and setting the trigger BEFORE DELETE doesn't delete the rows from the table (but it does execute the trigger, and it does insert the rows in the audit table), I dont' know why :(. Because the internal variable for NEW is

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Naeem Bari
I understand. Makes sense. Is there anyway for my trigger function to know that it is being called on a delete or on an update? Because I do need to return new on update... and I really don't want to write 2 different functions, one for update and one for delete... I would change the trigger to

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Naeem Bari
Ok, a really newbie question - I think I will switch to using after rather than before - but can I modify the trigger statement without dropping the trigger function? The reason I ask is that I actually wrote a program that takes oracle's DDL and generates all the tables, audit tables, triggers

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Jan Wieck
On 10/25/2004 3:47 PM, Tom Lane wrote: Naeem Bari [EMAIL PROTECTED] writes: CREATE OR REPLACE FUNCTION public.func_job_status_upd() RETURNS trigger AS ' begin insert into x_job_status values ( OLD.job_id, OLD.job_status_type_id, OLD.status_date, OLD.notes, OLD.edit_person_id, OLD.edit_date);

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Jan Wieck
On 10/25/2004 3:53 PM, Naeem Bari wrote: I understand. Makes sense. Is there anyway for my trigger function to know that it is being called on a delete or on an update? Because I do need to return new on update... and I really don't want to write 2 different functions, one for update and one for

[GENERAL] shared buffers

2004-10-25 Thread Glenn Sullivan
Hi, In the 7.4.5 version, the code is now trying to use a much larger value for shared_buffers. I can certainly set this to a lower number with the -B option. However, my guestion is: What is the performance issue with setting shared_buffers to something like 45? In doing some timing on my

[GENERAL] Error restoring bytea from dump

2004-10-25 Thread Egyd Csaba
Hi, the restoration of a dump stops at the line above. The dump was created with pgsql 7.3.2 and I need to pump it into a 7.4.3 one. Should anybody tell me what the problem can be and how I can solve it. (There are double apostophes [''] many times in the string - is it normal??? Besides of the

Re: [GENERAL] shared buffers

2004-10-25 Thread Tom Lane
Glenn Sullivan [EMAIL PROTECTED] writes: What is the performance issue with setting shared_buffers to something like 45? In doing some timing on my system, I cannot tell any difference with 45 versus 1000. What are you timing exactly? Almost every benchmark I've ever seen is much happier with

Re: [GENERAL] (S)RPMs for PostgreSQL 7.2.6, 7.3.8 and 7.4.6 are ready

2004-10-25 Thread Gaetano Mendola
Devrim GUNDUZ wrote: Hi, (S)RPMs for new point releases (per http://archives.postgresql.org/pgsql-announce/2004-10/msg00010.php) have been built for Fedora Core 12, Red Hat Linux 9 and Red Hat Enterprise Linux 3. If you want insert in the mirrors the RPMs for RH 2.1AS you can find them here:

[GENERAL] copy - fields enclosed by, ignore x lines

2004-10-25 Thread CSN
Any chance of changing \copy and COPY to allow specifying what the fields are enclosed by (such as quotes) and to ignore the first x number of lines? I have data like below and don't know of an easy way to finesse it for importing (a simple regexp would remove quotes, but I just got tripped up on

Re: [GENERAL] PgSQL MVCC vs MySQL InnoDB

2004-10-25 Thread Gaetano Mendola
Andrew Sullivan wrote: On Mon, Oct 25, 2004 at 01:15:33PM -0400, Jan Wieck wrote: On 10/25/2004 11:53 AM, [EMAIL PROTECTED] wrote: Is this true? From a functional point of view, the two appear to do the same thing. Well, except for one difference. InnoDB will allow you refer to tables not

Re: [GENERAL] copy - fields enclosed by, ignore x lines

2004-10-25 Thread CSN
Ah, looks like enclosed by will be in PG 8 :). Is QUOTE [ AS ] 'quote' for the enclosed by character? Ignore x lines would be nice, but not as big of a deal. http://developer.postgresql.org/docs/postgres/sql-copy.html --- CSN [EMAIL PROTECTED] wrote: Any chance of changing \copy and COPY

Re: [GENERAL] how to port Oracle database to PostgreSQL?

2004-10-25 Thread Oliver Elphick
On Mon, 2004-10-25 at 09:16 -0500, Vassilev, Lubomir G. wrote: Thanks for your reply, however as I am a total newbie around here, I've no clue how to get to postgresql-x.y.z/contrib. I looked on the main page but couldn't find it. It is part of the tarball that you download (if you download

[GENERAL] process hang during drop schema

2004-10-25 Thread David Parker
I have a process that hangs doing a drop schema cascade delete. This happens in a slonik command, which runs fine if I run it directly from the command line, but hangs if run from inside my process. I'm pretty sure I'm doing something silly and it's not a slony-specific thing, and I'm hoping

Re: [GENERAL] ON DELETE trigger blocks delete from my table

2004-10-25 Thread Oliver Elphick
On Mon, 2004-10-25 at 15:09 -0500, Naeem Bari wrote: Ok, a really newbie question - I think I will switch to using after rather than before - but can I modify the trigger statement without dropping the trigger function? CREATE OR REPLACE FUNCTION ... -- Oliver Elphick

[GENERAL] newbie

2004-10-25 Thread Rick
i installed mandrake 10 on my pc, and i choose postgresql as db, i installed it before in windows, but in linux i dont have idea what happends, i remebered that i should create an user, but in linux the process is auto and i when i try to connect by pgadmin i dont know user and password =( i

Re: [GENERAL] copy - fields enclosed by, ignore x lines

2004-10-25 Thread Pierre-Frdric Caillaud
Use python's (or another language) CSV reader module which will parse the quotes for you and write the values in a tab-delimited file. Don't forget to escape the tabs in the strings... it should be less than 10 lines of code. On Mon, 25 Oct 2004 14:45:57 -0700 (PDT), CSN [EMAIL

Re: [GENERAL] newbie

2004-10-25 Thread Uwe C. Schroeder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 log in as root and edit the file /var/lib/pgsql/data/postgresql.conf Right on the top there is a line #tcpip_socket=true make sure this line has no # in front (comment) and see that it has true as the value. Second check out pg_hba.conf At the end

Re: [GENERAL] process hang during drop schema

2004-10-25 Thread Tom Lane
David Parker [EMAIL PROTECTED] writes: To my untrained eye, it doesn't look as though there is any lock contention here, Me either; whatever that process is doing, it doesn't seem to be waiting for a lock. Is it accumulating CPU time? One way to get some info is to attach to the backend

[GENERAL] pg_restore does not restore

2004-10-25 Thread ruben
Hi: I'm trying to dump tableA and restore it to tableB: $ ./pg_dump -Fc -t tableA databaseA -f tableA.dump -v $ ./pg_restore -t tableB -d databaseA tableA.dump -v pg_dump creates tableA.dump aparently well, but after running pg_restore without errors I cannot find any tableB, what am I doing

Re: [GENERAL] pg_restore does not restore

2004-10-25 Thread Tom Lane
ruben [EMAIL PROTECTED] writes: I'm trying to dump tableA and restore it to tableB: pg_dump does not do that. The -t switch is for selecting one table among several, not for renaming anything. regards, tom lane ---(end of

[GENERAL] PostgreSQL 8.0.0 Beta 4 Now Available

2004-10-25 Thread Marc G. Fournier
After 4 weeks of work, involving alot of bug fixes, and documentation improvements, to the source tree, we have just released our 4th Beta of 8.0.0. Most of the items on Bruce's Open Items list have been completed, but we still have a half dozen or so Windows related items still open. For a

Re: [GENERAL] How to connect with postmaster through TCP socket

2004-10-25 Thread Neil Conway
On Mon, 2004-10-25 at 22:59, Deepa K wrote: Hi, I am using postgresql 7.1.3 in RedHatLinux 7.2. Note that PostgreSQL 7.1.3 is quite old -- you should consider upgrading. Can anyone tell me how to connect with postmaster through TCP socket (it is started with -i option) using libpq from an

[GENERAL] what could cause inserts getting queued up and db locking??

2004-10-25 Thread Brian Maguire
Background Info: I have a table with a approx 2.5 million rows. The table often gets 200-300 inserts per second. We are see that the database (7.4.1 Red Hat Enterprise ED 4 way Xeon) will periodically lock up all of a sudden and force the database to queue up hundreds of queries. The

[GENERAL] list fieldnames in table? (from PHP)

2004-10-25 Thread Miles Keaton
Is there a simple way to list fieldnames in a table, from PHP? When on the command-line, I just do \d tablename But how to get the fieldnames from PHP commands? ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an

[GENERAL] Theory!!

2004-10-25 Thread Mayra
hi, can anyone give me some info on the caracteristics of object relational databases and their advantages as well as disdvantages! thanx in advance.

Re: [GENERAL] list fieldnames in table? (from PHP)

2004-10-25 Thread Steven Klassen
* Miles Keaton [EMAIL PROTECTED] [2004-10-25 19:36:43 -0700]: Is there a simple way to list fieldnames in a table, from PHP? When on the command-line, I just do \d tablename But how to get the fieldnames from PHP commands? If your namespace is 'public' and your table is 'users', for

Re: [GENERAL] list fieldnames in table? (from PHP)

2004-10-25 Thread Michael Fuhr
On Mon, Oct 25, 2004 at 07:36:43PM -0700, Miles Keaton wrote: Is there a simple way to list fieldnames in a table, from PHP? When on the command-line, I just do \d tablename If you run psql -E or type \set ECHO_HIDDEN after you're in psql then you'll see the hidden queries that psql sends for

[GENERAL] [Fwd: Abrupt close of pgsql backend]

2004-10-25 Thread Deepa K
Original Message Subject: Abrupt close of pgsql backend From:Deepa K [EMAIL PROTECTED] Date:Mon, October 25, 2004 8:04 pm To: [EMAIL PROTECTED] -- Hi,