[GENERAL] problem with distinct rows

2005-03-08 Thread tony
Hello, I am having a problem with returning distinct rows this is probably a newbie question but here goes: Tables are artist, created_by and works the join is on created_by.work_id and created_by.artist_id A work of art can have two or more artists listed as creators in created by. In the

Re: [GENERAL] [Auth] 'ident' method and LDAP user accounts

2005-03-08 Thread Stephane Bortzmeyer
On Thu, Mar 03, 2005 at 01:20:35PM +0100, Florian Pflug [EMAIL PROTECTED] wrote a message of 47 lines which said: Seems so.. you could try to start the postmaster via strace -f, and capture the log ... Then try to connect, and see what happens - you should see the postmaster open your

[GENERAL] RPM for whitebox linux - RH ES3 Clone

2005-03-08 Thread Sanjay Arora
Hi Can someone please tell me if where rpm files for pgsql 8.1 for RH-ES3/whitbox linux can be found? Or do I have to compile? With best Rgds. Sanjay. ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command

[GENERAL] iterate over refcursor

2005-03-08 Thread FERREIRA William (COFRAMI)
Title: iterate over refcursor hi I got 2 functions write in pl/pgsql. In the first function, i create a cursor and i need to use it into an other function so the parameter is a refcursor. the code : 1st function : DECLARE childCursor CURSOR FOR select * from ... BEGIN

Re: [GENERAL] problem with distinct rows

2005-03-08 Thread John Sidney-Woollett
If the created_by table includes an artist number/position to indicate the first, second artist etc, eg create table created_by ( work_id integer, artist_id integer, position integer, primary key (work_id, artist_id, position) ); then you can simply use the following query select

Re: [GENERAL] problem with distinct rows

2005-03-08 Thread Martijn van Oosterhout
You can put the DISTINCT ON() query as a subquery, and an ORDER BY in the outer query. Sorting by surname is tricky since you need to tell the computer how to find it... Hope this helps, On Tue, Mar 08, 2005 at 10:03:48AM +0100, tony wrote: Hello, I am having a problem with returning

Re: [GENERAL] problem with distinct rows

2005-03-08 Thread John Sidney-Woollett
Add a SORTNAME field to the artist table and use that for sorting. This will help you deal with diacrtics and accented characters by transposing them to a regular character instead. The sortname value for Genée would be genee. With a few changes to your data model (and possibly application) you

Re: [GENERAL] problem with distinct rows

2005-03-08 Thread tony
Le mardi 08 mars 2005 à 11:04 +0100, Martijn van Oosterhout a écrit : You can put the DISTINCT ON() query as a subquery, and an ORDER BY in the outer query. That was my first guess select number.inventorynumber, name, first_name from (select distinct on (inventorynumber) inventorynumber from

Re: [GENERAL] problem with distinct rows

2005-03-08 Thread Martijn van Oosterhout
On Tue, Mar 08, 2005 at 12:22:35PM +0100, tony wrote: Le mardi 08 mars 2005 à 11:04 +0100, Martijn van Oosterhout a écrit : You can put the DISTINCT ON() query as a subquery, and an ORDER BY in the outer query. That was my first guess select number.inventorynumber, name, first_name

Re: [GENERAL] Restoring db objects , help needed

2005-03-08 Thread Hugo
Hi , thanks for the advice, I checked the pg_restore command and I can restore individual objects to different databases, but what I'm trying to do is to restore a schema X renamed to schema B in the same database, when I restore the db object it always restores it to the original schema, is it

Re: [GENERAL] iterate over refcursor

2005-03-08 Thread Sim Zacks
Title: iterate over refcursor try fetch as in: fetch childcursor into variablelist; while Found LOOP --Do stuff; --Do More Stuff; --Finish Doing Stuff; fetch childcursor into variablelist; END LOOP; found is set to false if there is nothing to fetch ""FERREIRA William (COFRAMI)""

Re: [GENERAL] iterate over refcursor

2005-03-08 Thread Sim Zacks
Title: iterate over refcursor Will, In the future, please respond to the list and not to me personally. your refcursor is essentially a list of records. the variable list depends on your cursor. your cursor contains records of select * from ... You want to use a loop because you want to

Re: [GENERAL] postgresql vs mysql performance comparison

2005-03-08 Thread Howard Cole
You may want to consider other things... MySQL adds complexity in that it has several database engines: MyISAM, InnoDB and MAXDB. All of which have different performance characteristics. MyISAM is very fast for databases with few transactions, but InnoDB is more comparable to Postgres in that

Re: [GENERAL] Restoring db objects , help needed

2005-03-08 Thread Lonni J Friedman
I've honestly never tried doing that. The only method that I can think of is to manually rename the schema inside your dump before importing/restoring. Mind if i ask why you want/need to do this? On Tue, 8 Mar 2005 07:51:53 -0400, Hugo [EMAIL PROTECTED] wrote: Hi , thanks for the advice, I

Re: [GENERAL] RPM for whitebox linux - RH ES3 Clone

2005-03-08 Thread Lonni J Friedman
On Tue, 8 Mar 2005 15:02:04 +0530, Sanjay Arora [EMAIL PROTECTED] wrote: Hi Can someone please tell me if where rpm files for pgsql 8.1 for RH-ES3/whitbox linux can be found? Or do I have to compile? 8.1? I don't think that even exists yet. Did you mean 8.0.1 ?

Re: [GENERAL] problem with distinct rows

2005-03-08 Thread tony
Le mardi 08 mars 2005 à 12:29 +0100, Martijn van Oosterhout a écrit : and, does it work? Obviously you need to put the joins in and such. But the outer query should be last, like: SELECT * FROM (... subquery ...) AS x ORDER BY name; The outer query is only for ordering, the joins, etc

Re: [GENERAL] RPM for whitebox linux - RH ES3 Clone

2005-03-08 Thread Devrim GUNDUZ
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, On Tue, 8 Mar 2005, Sanjay Arora wrote: Can someone please tell me if where rpm files for pgsql 8.1 for RH-ES3/whitbox linux can be found? Or do I have to compile? RHEL ES 3 RPMs for 8.0.1 (latest version) are at

Re: [GENERAL] postgresql vs mysql performance comparison

2005-03-08 Thread Shelby Cain
--- Howard Cole [EMAIL PROTECTED] wrote: Although not appropriate for a speed comparison, you might want to note that the use of Mysql versions 4.0 upward now require commercial license for clients, which are no longer LGPL, whereas Postgres is free (BSD license). This makes

Re: [GENERAL] Simple query takes 5+ minutes

2005-03-08 Thread Howard Cole
Have you tried a cross join with a where statement as an alternative? e.g. select select i.internalid, c.code from local.internal i, country.ip c where i.ip between c.startip and c.endip; Howard Cole www.selestial.com Jesse D. wrote: select i.internalid, c.code from local.internal i inner join

[GENERAL] Move cursor

2005-03-08 Thread FERREIRA William (COFRAMI)
Title: iterate over refcursor hi i need to use the MOVE function on a cursor, for extracting special rows. the function is written in pl/pgSQL CREATE OR REPLACE FUNCTION TEST() RETURNS void AS $$DECLARE childCursor CURSOR FOR select * from...childRecord adoc.xdb_child%ROWTYPE; dep

Re: [GENERAL] postgresql vs mysql performance comparison

2005-03-08 Thread Scott Marlowe
On Tue, 2005-03-08 at 09:06, Shelby Cain wrote: --- Howard Cole [EMAIL PROTECTED] wrote: Although not appropriate for a speed comparison, you might want to note that the use of Mysql versions 4.0 upward now require commercial license for clients, which are no longer LGPL, whereas

Re: [GENERAL] Vacuum time degrading

2005-03-08 Thread Wes
Well, the good news is that the 2.24.29 kernel solved the kswapd problem. That bad news is that it didn't help the vacuum time. In fact, the vacuum time is now over 6 hours instead of 5 hours. Whether that is a direct result of the 2.24.29 kernel, or a coincidence, I don't know at this time. I

Re: [GENERAL] Move cursor

2005-03-08 Thread Michael Fuhr
On Tue, Mar 08, 2005 at 04:23:37PM +0100, FERREIRA William (COFRAMI) wrote: i need to use the MOVE function on a cursor, for extracting special rows. the function is written in pl/pgSQL I don't think PL/pgSQL implements cursors fully. In particular, I don't see MOVE in the PL/pgSQL parser; I

Re: [GENERAL] postgresql vs mysql performance comparison

2005-03-08 Thread Tom Lane
Scott Marlowe [EMAIL PROTECTED] writes: However, Fedora Core 2 still includes MySQL V 3.xx.yy because of the issues wth V4.xx.yy's licensing. However, Suse does include the latest version. So there's some difference of opinion on the issue from different distros. Not any more --- it's just

Re: [GENERAL] postgresql vs mysql performance comparison

2005-03-08 Thread Rick Casey
This will not answer you question, but documents some of the evidence for you: http://www.geocities.com/mailsoftware42/db/ Rick Casey, Research Associate Institute for Behavioral Genetics [EMAIL PROTECTED] 303.735.3518 Rick Schumeyer wrote: Im interested in comparing the performance of

Re: [GENERAL] Move cursor

2005-03-08 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] writes: I don't think PL/pgSQL implements cursors fully. Its cursor facility is certainly far weaker than what's presently in the main SQL language. I think this is at least partly historical accident (ie we upgraded the main language and forgot about plpgsql).

Re: [GENERAL] Move cursor

2005-03-08 Thread Michael Fuhr
On Tue, Mar 08, 2005 at 12:16:28PM -0500, Tom Lane wrote: Michael Fuhr [EMAIL PROTECTED] writes: I don't think PL/pgSQL implements cursors fully. Its cursor facility is certainly far weaker than what's presently in the main SQL language. I think this is at least partly historical accident

[GENERAL] Stuck with a query...

2005-03-08 Thread Geoff Caplan
Hi folks, Sorry to ask a newbie SQL question but I'm struggling... I have a website clickstream log: request_id session_id sequence_num url 100 xxx 1 /foo 101 xxx 2 /bar 102 xxx 3 /hoo 103 yyy

Re: [GENERAL] Stuck with a query...

2005-03-08 Thread Greg Stark
Geoff Caplan [EMAIL PROTECTED] writes: Hi folks, Sorry to ask a newbie SQL question but I'm struggling... There's no efficient way to write this in standard SQL. However Postgres has an extension DISTINCT ON that would do it: select url,count(*) from (select distinct on (session_id)

Re: [GENERAL] Stuck with a query...

2005-03-08 Thread Geoff Caplan
Greg, GS There's no efficient way to write this in standard SQL. GS However Postgres has an extension DISTINCT ON that would GS do it: Works as advertised - many thanks! I'd missed the DISTINCT ON extension... This really is a great list - you've saved me a couple of hours of agony, I suspect.

[GENERAL] SRF, JDBC and result info

2005-03-08 Thread ntinos
Hi everybody! I have an SRF which is called from a JAVA app with JDBC. Everything works fine and I want now to be able to pass some result-related info to my app. It is not about the format of the results (ResultSetMetaData) or something like that. Is it possible to return some string (or

Re: [GENERAL] LIMIT and his implementation

2005-03-08 Thread Ladislav Linhart
Hello, I don't have a problem. I would like know,  how is it implemented on low-level (base) layer. I'm sorry for my english. Thank you for your answers LADiS On Mon, Mar 07, 2005 at 11:31:06AM +0100, Ladislav Linhart wrote: Create temprorary table before applyes LIMIT ? Exists any way for

[GENERAL] Pgsql dynamic statements and null values

2005-03-08 Thread Guy Rouillier
We use a dynamic statement in a pgsql stored function to insert rows into a table determined at run time. After much debugging, I've discovered that a null incoming argument will cause the dynamic statement to evaluate to null. The error message emitted is unable to execute null statement. I

[GENERAL] Can't delete - Need cascading update instead

2005-03-08 Thread Adam Tomjack
For various reasons, I can't actually delete records from my database. Instead, I have a boolean 'active' field for each table. I need to implement something like cascading delete, but instead of deleting, I need to set active=false. I've googled and haven't found a solution. I had two

Re: [GENERAL] postgresql vs mysql performance comparison

2005-03-08 Thread Chris Travers
Scott Marlowe wrote: On Tue, 2005-03-08 at 09:06, Shelby Cain wrote: --- Howard Cole [EMAIL PROTECTED] wrote: Although not appropriate for a speed comparison, you might want to note that the use of Mysql versions 4.0 upward now require commercial license for clients, which are no longer

[GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Tope Akinniyi
Hi, I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of PostgreSQL at all? Take a look at tools being rolled out at PgFoundry on daily basis; all for Linux except the Windows

Re: [GENERAL] Disabling triggers in a transaction

2005-03-08 Thread Bruce Momjian
Geoffrey wrote: Terry Lee Tucker wrote: Tom, Do you feel this is a safe method for disabling triggers in the rare cases where one finds that it is prudent to do that? Do you think that the column, reltriggers, is permanent fixture in pg_class? What is your advice on this?

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Joshua D. Drake
Tope Akinniyi wrote: Hi, I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of PostgreSQL at all? I believe that there is a lot of encouragement of the use of PostgreSQL on

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Robby Russell
On Wed, 2005-03-09 at 03:24 +, Tope Akinniyi wrote: Hi, I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of PostgreSQL at all? Take a look at tools being rolled out at

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Michael Fuhr
On Wed, Mar 09, 2005 at 03:24:05AM +, Tope Akinniyi wrote: I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of PostgreSQL at all? I don't see the extreme Linux mentality you

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Tom Lane
Tope Akinniyi [EMAIL PROTECTED] writes: I am not holding anybody responsible, but I think we need to do a massive re-orientation of the community not to carry the Linux-Windows game too far. This is a troll, isn't it? regards, tom lane ---(end

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Joshua D. Drake
Tom Lane wrote: Tope Akinniyi [EMAIL PROTECTED] writes: I am not holding anybody responsible, but I think we need to do a massive re-orientation of the community not to carry the Linux-Windows game too far. This is a troll, isn't it? I don't know, the email was fairly thought out. I

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Uwe C. Schroeder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tuesday 08 March 2005 07:24 pm, Tope Akinniyi wrote: Hi, I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of PostgreSQL at all?

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Edwin New
Title: RE: [GENERAL] PostgreSQL still for Linux only? I don't want to split hairs, but wasn't Firebird originally Interbase? If so, you'll find it was originally a *nix product before it was a Windows database (back in the Ashton-Tate days for those with long memories). Edwin New.

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Tim Allen
Tom Lane wrote: Tope Akinniyi [EMAIL PROTECTED] writes: I am not holding anybody responsible, but I think we need to do a massive re-orientation of the community not to carry the Linux-Windows game too far. This is a troll, isn't it? Perhaps it's a 419 :-). But if so I can't see the catch yet -

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread javier wilson
On Tuesday 08 March 2005 07:24 pm, Tope Akinniyi wrote: Hi, I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of PostgreSQL at all? Take a look at tools being rolled out

I couldnt get it : Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Nilabhra Banerjee
Hi folks Tell me one thing... what is cygwin + postgresql then? I find it cool with Windows. And why Linux only? I successfully deployed it in various other platforms including AIX and IRIX.(Thanks to postgresql community. I think loading and running Oracle in Windows (or any other platform)

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Tom Lane
Tim Allen [EMAIL PROTECTED] writes: Tom Lane wrote: This is a troll, isn't it? Perhaps it's a 419 :-). But if so I can't see the catch yet - must be very subtle. Nothing very subtle about it. In the first place, I'm not going to waste my breath debating anyone who thinks Linux == every

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Uwe C. Schroeder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thinking about it you may be right. I guess I'm misstaking it for something else. Too many foxes out here nowadays :-) To the topic: I don't argue the benefit of a native windows version from a marketing point of view (although not so from a

Re: [GENERAL] Disabling triggers in a transaction

2005-03-08 Thread Net Virtual Mailing Lists
It is the only known way to control triggers though it isn't regularly tested by the developers. I think I've come up with another way.. I posted this recently, but did not get any feedback on it so I'm not sure how dumb it is... It is working really great for me though All I did was

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread J. Greenlees
Uwe C. Schroeder wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tuesday 08 March 2005 07:24 pm, Tope Akinniyi wrote: Hi, I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread Ian Barwick
On Wed, 9 Mar 2005 16:02:46 +1100, Edwin New [EMAIL PROTECTED] wrote: I don't want to split hairs, but wasn't Firebird originally Interbase? If so, you'll find it was originally a *nix product before it was a Windows database (back in the Ashton-Tate days for those with long memories).

Re: [GENERAL] PostgreSQL still for Linux only?

2005-03-08 Thread tony
Le mardi 08 mars 2005 à 22:17 -0800, J. Greenlees a écrit : I am wondering at this display of extreme Linux mentality being displayed by the 'top bras' of the PostgreSQL community. And I ask, are we encouraging Windows use of PostgreSQL at all? I run my development server on Mac OS X. If a