MD5 computation (was: RE: [GENERAL] For Tom Lane)

2005-06-01 Thread Philippe Lang
Hi, What is the best way to calculate an MD5 Sum for a set of rows in a table, on a Postgresql server? -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Scott Marlowe Envoyé : mardi, 31. mai 2005 18:37 À : [EMAIL PROTECTED] Cc : pgsql-general Objet : Re:

[GENERAL] TableSpaces across partitions and xlog

2005-06-01 Thread Himanshu Baweja
Moving table spaces along raids definately helps but will moving tablespaces across partitions help??? in my opinion it should lead to degradation of performance because read/write head will have to move more. also, i have two raids my data is in first one... and xlog in the other.

Re: MD5 computation (was: RE: [GENERAL] For Tom Lane)

2005-06-01 Thread Neil Conway
On Wed, 2005-06-01 at 08:22 +0200, Philippe Lang wrote: What is the best way to calculate an MD5 Sum for a set of rows in a table, on a Postgresql server? The md5() builtin function. contrib/pgcrypto is available if you need more sophisticated hashing / encryption. -Neil

Re: [GENERAL] Shared memory and FreeBSD's jail()

2005-06-01 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-05-19 12:14:58 -0400: lister [EMAIL PROTECTED] writes: This was the topic of 20 minutes of conversation in 2 tutorials at BSDCan. Well, if the BSD people are so concerned about it, why don't they fix their bleedin' OS? It's inexcusable to have a jail feature

Re: [GENERAL] Issue with OS X

2005-06-01 Thread Adam Witney
You will need to modify your shared memory settings or change your shared_buffers parameter in the postgresql.conf file. (Most likely need to increase SHMMAX as the default for OSX is quite low as I recall) Take a look here: http://www.postgresql.org/docs/8.0/static/kernel-resources.html There

Re: [GENERAL] Missing numbers

2005-06-01 Thread Simon Riggs
On Wed, 2005-06-01 at 00:27 -0400, Alvaro Herrera wrote: On Wed, Jun 01, 2005 at 01:21:28AM +0100, Simon Riggs wrote: On Tue, 2005-05-31 at 18:28 +0200, Harald Fuchs wrote: SELECT g.num FROM generate_series ((SELECT min(doc_numero) FROM bdocs), (SELECT

Re: [GENERAL] Missing numbers

2005-06-01 Thread Harald Fuchs
In article [EMAIL PROTECTED], Simon Riggs [EMAIL PROTECTED] writes: If the WHERE clause said bdocs.doc_numero 7 we would hope that this was applied before the join. Stating this would change the OUTER into an INNER JOIN, and this would imply that the order of the restrictions is irrelevant -

Re: [GENERAL] PostgreSQL release schedule

2005-06-01 Thread Bruce Momjian
Robert Treat wrote: On Tuesday 24 May 2005 23:49, Tom Lane wrote: Bruno Wolff III [EMAIL PROTECTED] writes: Marc G. Fournier [EMAIL PROTECTED] wrote: Estimate right now for going beta on 8.1 is July 1st ... aiming for a Isn't that feature freeze? Typically there has been a month

[GENERAL] Newby to DB

2005-06-01 Thread Bob Pawley
Hi I'm a new user to Postgresql. I've installed it as an application in Windows. My intent is togain experience in usingsql to build a database. I'm having problems understanding how to begin. When I start the database is there any indicator that it is actually running? Do I need to add

[GENERAL] prevent user change password?

2005-06-01 Thread Richard Hayward
Is it possible to prevent a user from changing their password? I have a database with a 'Guest' account, that will have limited access. I don't want any of my guests to change the Guest account password. tia Richard ---(end of broadcast)--- TIP 2:

Re: [GENERAL] Newby to DB

2005-06-01 Thread John DeSoi
Bob, On May 31, 2005, at 3:24 PM, Bob Pawley wrote: I'm a new user to Postgresql.   I've installed it as an application in Windows. My intent is to gain experience in using sql to build a database.   I'm having problems understanding how to begin.   When I start the database is there any

Re: [GENERAL] Missing numbers

2005-06-01 Thread josue
Simon Riggs wrote: You could use something like that: SELECT g.num FROM generate_series ((SELECT min(doc_numero) FROM bdocs), (SELECT max(doc_numero) FROM bdocs)) AS g(num) LEFT JOIN bdocs ON bdocs.doc_numero = g.num WHERE bdocs.doc_numero IS NULL SELECT g.num FROM

[GENERAL] SQL question.

2005-06-01 Thread FC
Hello SQL Aces ! I want to do a select on a table distinct on linkid and sorted by date. I have try this SELECT DISTINCT ON (linkid) * FROM all_links WHERE uid='2' AND DATE_TRUNC('day',read_date) = DATE_TRUNC('day', TIMESTAMP '2005-06-01') ORDER BY linkid, read_date; With this

Re: [GENERAL] Missing numbers

2005-06-01 Thread Dan Black
you can also try this =) select o1.doc_numero+1 as first, ((select doc_numero from bdocs where id o1.doc_numero+1 order by doc_numero limit 1))-1 as last from bdocs as o1 where o1.doc_numero+1 not in (select o2.doc_numero from bdocs as o2) order by doc_numero2005/5/31, josue [EMAIL

[GENERAL] Can I catch sentences in SQL using triggers?

2005-06-01 Thread Manuel García
Hello Everybody, somebody knows if its possible to catch one sentences in full SQL using the triggers, or maybe somebody have any idea about to how do it? I am using postgreSQL 7.3 on fedora core 1 Thanks in advancedManuel

Re: [GENERAL] SQL question.

2005-06-01 Thread Jim Buttafuoco
how about (untested) select * from ( SELECT DISTINCT ON (linkid) * FROM all_links WHERE uid='2' AND DATE_TRUNC('day',read_date) = DATE_TRUNC('day',TIMESTAMP '2005-06-01') ORDER BY linkid ) A ORDER BY read_date DESC limit 100 -- Original Message --- From: FC [EMAIL

Re: [GENERAL] Missing numbers

2005-06-01 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: On Wed, 2005-06-01 at 00:27 -0400, Alvaro Herrera wrote: SELECT g.num FROM generate_series ((SELECT min(doc_numero) FROM bdocs), (SELECT max(doc_numero) FROM bdocs)) AS g(num) LEFT JOIN bdocs ON bdocs.doc_numero = g.num WHERE bdocs.doc_numero IS NULL I

[GENERAL] Old problem needs solution

2005-06-01 Thread Gerald D. Anderson
Greetings! At some point, I'm not even sure when, I apparently had a bad upgrade on one of my production databases. I'm in a situation now where I've got my back up against a wall and not sure what to do. The problem is, I'm receiving this message frequently: did not find '}' at end of

Re: [GENERAL] SQL question.

2005-06-01 Thread Martijn van Oosterhout
On Wed, Jun 01, 2005 at 04:40:48PM +0200, FC wrote: Hello SQL Aces ! I want to do a select on a table distinct on linkid and sorted by date. I have try this How about a subquery?: SELECT * FROM ( SELECT DISTINCT ON (linkid) * FROM all_links WHERE uid='2' AND

[GENERAL] Autonomous Transactions

2005-06-01 Thread Matt Miller
I'm looking for a way to enable a function to commit a unit of work that does not affect the caller's transaction. I'm coming from the Oracle world where I've used the autonomous_transaction pragma of PL/SQL to do this. I'm new to Postgres, but I'm hopeful that I can move our systems from

Re: [GENERAL] prevent user change password?

2005-06-01 Thread Tom Lane
Richard Hayward [EMAIL PROTECTED] writes: Is it possible to prevent a user from changing their password? No. I have a database with a 'Guest' account, that will have limited access. I don't want any of my guests to change the Guest account password. Perhaps you should use something other

Re: [GENERAL] Can I catch sentences in SQL using triggers?

2005-06-01 Thread Richard Huxton
Manuel García wrote: Hello Everybody, somebody knows if its possible to catch one sentences in full SQL using the triggers, or maybe somebody have any idea about to how do it? I am using postgreSQL 7.3 on fedora core 1 If I understand, you want to access the query, e.g. SELECT * FROM

Re: [GENERAL] [UMN_MAPSERVER-USERS] FYI: Google to pay student open source developers

2005-06-01 Thread Richard_D_Levine
I'm cross posting this because it is an excellent opportunity for students. I was a paid intern (studying pterodactyls), and my company employs paid interns to perform well bounded summer projects. The intern gains invaluable industry experience and a semester's worth of tuition (or beer). One

Re: [GENERAL] Old problem needs solution

2005-06-01 Thread Richard Huxton
Gerald D. Anderson wrote: Greetings! At some point, I'm not even sure when, I apparently had a bad upgrade on one of my production databases. I'm in a situation now where I've got my back up against a wall and not sure what to do. The problem is, I'm receiving this message frequently:

[GENERAL] Question about backing up partial Database

2005-06-01 Thread David Link
Hi, Can pg_dump be used to backup a selected number of tables, (rather than All or One)? We have a case where we need to backup tables of the form sale_2001xx, or sale_2002xx, etc. Our current solution is the following: pg_dump -d dbname -t sale_200101 sales_2001_dump pg_dump -d

Re: [GENERAL] Old problem needs solution

2005-06-01 Thread Gerald D. Anderson
data # pg_dump -Fc -f blah.txt -tforums_auth forums22 -u User name: postgres Password: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: did not find '}' at end of input node pg_dump: The command was: SELECT (SELECT usename FROM pg_user WHERE usesysid = datdba) as

Re: [GENERAL] Can I catch sentences in SQL using triggers?

2005-06-01 Thread Manuel García
Ok. Richard, that is that I need to do, I need to create a log table with all the information that is changed on every row that was update, delete or insert, additionally I must be record the user that do that. At this point I don't have troubles I can do that, but I need to get the full

Re: [GENERAL] Old problem needs solution

2005-06-01 Thread Alvaro Herrera
On Wed, Jun 01, 2005 at 10:24:25AM -0500, Gerald D. Anderson wrote: Greetings! At some point, I'm not even sure when, I apparently had a bad upgrade on one of my production databases. I'm in a situation now where I've got my back up against a wall and not sure what to do. The problem is,

Re: [GENERAL] Autonomous Transactions

2005-06-01 Thread Alvaro Herrera
On Wed, Jun 01, 2005 at 03:38:01PM +, Matt Miller wrote: I'm looking for a way to enable a function to commit a unit of work that does not affect the caller's transaction. I'm coming from the Oracle world where I've used the autonomous_transaction pragma of PL/SQL to do this. I'm new to

Re: [GENERAL] SQL question.

2005-06-01 Thread FC
I need to remember to keep things simple... Works fine, thanks. Fred On Jun 1, 2005, at 5:20 PM, Jim Buttafuoco wrote: how about (untested) select * from ( SELECT DISTINCT ON (linkid) * FROM all_links WHERE uid='2' AND DATE_TRUNC('day',read_date) = DATE_TRUNC ('day',TIMESTAMP

Re: [GENERAL] Newby to DB

2005-06-01 Thread John DeSoi
On Jun 1, 2005, at 11:52 AM, Bob Pawley wrote: Dear Mr. DeSoi Thank you for responding. I originally installed it as a service. However, I wasn't able to make the connection to the server. (I am assuming the red X next to the server name means that it is off.) Thinking there might be a

Re: [GENERAL] Autonomous Transactions

2005-06-01 Thread Scott Marlowe
On Wed, 2005-06-01 at 10:52, Alvaro Herrera wrote: On Wed, Jun 01, 2005 at 03:38:01PM +, Matt Miller wrote: I'm willing to use a different language, or even the libpq API if necessary. If you really need autonomous transactions, you can establish an independent connection within a

Re: [GENERAL] For Tom Lane

2005-06-01 Thread Jeff Eckermann
Scott Marlowe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 2005-05-27 at 09:57, [EMAIL PROTECTED] wrote: Thanks for answer Tom Consider what happens when the user leaves for lunch Well, I've already thought about it.But I'm working with VS2003 and disconnected

Re: [GENERAL] prevent user change password?

2005-06-01 Thread Bruno Wolff III
On Tue, May 31, 2005 at 18:03:04 +0100, Richard Hayward [EMAIL PROTECTED] wrote: Is it possible to prevent a user from changing their password? I have a database with a 'Guest' account, that will have limited access. I don't want any of my guests to change the Guest account password. Your

Re: [GENERAL] How to wait until startup completes

2005-06-01 Thread Gary Horton
Tom Lane wrote: Gary Horton [EMAIL PROTECTED] writes: [ assorted startup problems ] You did not say what platform this is on, nor which Postgres version you are running. Tsk tsk. Actually I did mention 7.3.4 Postgres but obviously I didn't do it clearly. I really

Re: [GENERAL] Old problem needs solution

2005-06-01 Thread Richard Huxton
Gerald D. Anderson wrote: data # pg_dump -Fc -f blah.txt -tforums_auth forums22 -uUser name: postgres Password: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: did not find '}' at end of input node pg_dump: The command was: SELECT (SELECT usename FROM pg_user

Re: [GENERAL] How to wait until startup completes

2005-06-01 Thread Tom Lane
Gary Horton [EMAIL PROTECTED] writes: Tom Lane wrote: The -w-doesn't-wait-long-enough bit needs investigation. No messages, no smoking gun. If you mean running the sh script with -x, it's really not complicated enough to warrant that - I've added echo statements to confirm that it's just

Re: [GENERAL] Can I catch sentences in SQL using triggers?

2005-06-01 Thread Richard Huxton
Manuel García wrote: Ok. Richard, that is that I need to do, I need to create a log table with all the information that is changed on every row that was update, delete or insert, additionally I must be record the user that do that. At this point I don't have troubles I can do that, but I need

Re: [GENERAL] How to wait until startup completes

2005-06-01 Thread Gary Horton
Tom Lane wrote: Yeah ... in fact, if you read the script, what it does is loop until a psql -l succeeds ... so why wouldn't your following instance also succeed? regards, tom lane Ah, I think that you mean to run pg_ctl with a -x option (not my own sh script). I didn't realize I

Re: [GENERAL] Old problem needs solution

2005-06-01 Thread Tom Lane
Richard Huxton dev@archonet.com writes: Yep - I'm guessing it's an issue with an array (group membership?) in pg_user. No, I'll bet lunch that Alvaro fingered the correct culprit: either addition or subtraction of that darn hierarchical-query patch. It changes the on-disk representation of

[GENERAL] Status of interactive psql's error handling?

2005-06-01 Thread Greg Stark
What's the current status on psql handling typos and interrupts more usefully by automatically encapsulating every statement in a savepoint? I'm just curious whether it's already in for 8.1 or if it got stalled. I ask because I just got bit again by a typo where I accidently deleted the wrong

[GENERAL] hpw to Count without group by

2005-06-01 Thread Yudie Pg
Hello, I have a table, structure like this: create table product( sku, int4 not null, category int4 null, display_name varchar(100) null, rank int4 null ) let say example data: sku, category, display_name === 10001, 5, postgresql, 132 10002, 5, mysql, 243 10003, 5, oracle,

[GENERAL] SRFs returning records from a view

2005-06-01 Thread mark . lubratt
Hello! I have a view that I'm putting into a report in my application. I'd like to get several blank lines returned by the view as well as the legitimate data (to leave room in the report for manual entries). I thought I could make a SRF that would return the data from the view and then spit

Re: [GENERAL] Status of interactive psql's error handling?

2005-06-01 Thread Bruce Momjian
Greg Stark wrote: What's the current status on psql handling typos and interrupts more usefully by automatically encapsulating every statement in a savepoint? I'm just curious whether it's already in for 8.1 or if it got stalled. I ask because I just got bit again by a typo where I

Re: [GENERAL] SRFs returning records from a view

2005-06-01 Thread Joshua D. Drake
[EMAIL PROTECTED] wrote: Hello! I have a view that I'm putting into a report in my application. I'd like to get several blank lines returned by the view as well as the legitimate data (to leave room in the report for manual entries). I thought I could make a SRF that would return the data

Re: [GENERAL] SRFs returning records from a view

2005-06-01 Thread mark . lubratt
Original Message Subject: Re: [GENERAL] SRFs returning records from a view From: Joshua D. Drake [EMAIL PROTECTED] Date: Wed, June 01, 2005 4:39 pm To: [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org [EMAIL PROTECTED] wrote: Hello! I have a view that I'm

Re: [GENERAL] PITR restore hot standby

2005-06-01 Thread [EMAIL PROTECTED]
thanks for your reply, I did not presume that it is a bug, I am interested to know how can I setup a hot standby (if is some more documentation available). ===QUOTE FROM DOCS=== If we continuously feed the series of WAL files to another machine that has been loaded with the same base backup

Re: [GENERAL] PITR restore hot standby

2005-06-01 Thread Simon Riggs
On Thu, 2005-06-02 at 01:13 +0300, [EMAIL PROTECTED] wrote: In this case do you know what is the timeout on the restore_command command (or where I can find it in documentation). There isn't one. You decide when restore_command returns. What will happen if I make the restore command wait for

Re: [GENERAL] hpw to Count without group by

2005-06-01 Thread Ragnar Hafstað
On Wed, 2005-06-01 at 16:16 -0500, Yudie Pg wrote: Hello, I have a table, structure like this: [...] Expected query result: sku, category, display_name, category_count 10001, 5, postgresql, 3 10006, 7, photoshop, 2 10008, 9, Windows XP, 2 The

Re: [GENERAL] interval integer comparison

2005-06-01 Thread Havasvölgyi Ottó
Thank you Tom. It was a bit confusing because my WHERE clause looked something like this: ... WHERE date_field - current_date '21 days'::interval; And then I got records, whose with date_field's year was 2010. :-o Now I am using this formula: ... WHERE date_field current_date + '21

[GENERAL] Deleting orphaned records to establish Ref Integrity

2005-06-01 Thread Roman F
I have several large tables (10 million to 200 million rows) that have foreign keys with each other by *convention*, but no actual FOREIGN KEY constraints. Over the course of years, orphaned records (children with no parent) have accumulated and now I want to clean them up. I can't just create

Re: [GENERAL] interval integer comparison

2005-06-01 Thread Bruno Wolff III
On Thu, Jun 02, 2005 at 01:54:12 +0200, Havasvölgyi Ottó [EMAIL PROTECTED] wrote: Thank you Tom. It was a bit confusing because my WHERE clause looked something like this: ... WHERE date_field - current_date '21 days'::interval; And then I got records, whose with date_field's year was