Re: [GENERAL] Building postgres on Suze

2005-09-13 Thread Thomas Pundt
Hi, first off - what annoyes me in the PostgreSQL mailing lists is that posters regularly break threads. Why can't you create a new mail for a new topic without replying to another mail with a totally different topic? On Monday 12 September 2005 23:51, Christian Goetze wrote: | I'm trying to bui

Re: [GENERAL] Utility that creates table schema from csv data?

2005-09-13 Thread Richard Huxton
CSN wrote: Probably wishful thinking, but who knows - maybe there's something in contrib! I have a bunch of csv data with the field names specified on the first line of the various files. Is there any such utility that will create a table schema using the field names AND look through the data and

[GENERAL] kernel log un upgrade of postgresql-common

2005-09-13 Thread Martín Marqués
I upgraded yesterday postgresql-common on Debian Sparc (testing) and I find that there was a log in my kern.log file: ioctl32(pg_checksystem:25007): Unknown cmd fd(3) cmd(030e){00} arg(000bfb88) on /dev/hda Is this something to worry about or is it a failed check that got logged? -- 07:3

Re: [GENERAL] Email Verfication Regular Expression

2005-09-13 Thread Stephane Bortzmeyer
On Wed, Sep 07, 2005 at 12:21:45PM -0700, Steve Atkins <[EMAIL PROTECTED]> wrote a message of 26 lines which said: > /[EMAIL PROTECTED]@(?:[EMAIL > PROTECTED])?[a-z0-9-_]+\.(?:a[defgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmoz]|e[ceghrst]|f[ijkmorx]|g[abdefhilmnpqrstuwy]

Re: [GENERAL] Email Verfication Regular Expression

2005-09-13 Thread Stephane Bortzmeyer
On Thu, Sep 08, 2005 at 12:16:36PM -0600, Cristian Prieto <[EMAIL PROTECTED]> wrote a message of 66 lines which said: > res = res_query(name, C_IN, T_MX, answer, sizeof(answer)); Besides Randal Schwartz' excellent remark (do not forget the records, too), remember that the Internet is not

Re: [GENERAL] Utility that creates table schema from csv data?

2005-09-13 Thread Reid Thompson
Richard Huxton wrote: > CSN wrote: >> Probably wishful thinking, but who knows - maybe >> there's something in contrib! I have a bunch of csv >> data with the field names specified on the first line >> of the various files. Is there any such utility that >> will create a table schema using the fiel

Re: [GENERAL] Replication

2005-09-13 Thread Tatsuo Ishii
> You can use PITR to archive transaction logs to a second server that is > kept in standby mode. > > This will cope with any number of tables and cope with dynamic changes > to tables. > > This is fairly straightforward and very low overhead. > Set archive_command to a program that transfers xlo

Re: [GENERAL] Replication

2005-09-13 Thread Simon Riggs
> From: Tatsuo Ishii [mailto:[EMAIL PROTECTED] > > You can use PITR to archive transaction logs to a second > server that is > > kept in standby mode. > > > > This will cope with any number of tables and cope with > dynamic changes > > to tables. > > > > This is fairly straightforward and very low

Re: [GENERAL] PostgreSQL and XML support

2005-09-13 Thread Andrey Fomichev
Thank you very much for your answers. Friendly, Andrey ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through

Re: [GENERAL] kernel log un upgrade of postgresql-common

2005-09-13 Thread Tom Lane
=?iso-8859-1?q?Mart=EDn_Marqu=E9s?= writes: > I upgraded yesterday postgresql-common on Debian Sparc (testing) and I find > that there was a log in my kern.log file: > ioctl32(pg_checksystem:25007): Unknown cmd fd(3) cmd(030e){00} > arg(000bfb88) on /dev/hda > Is this something to worry abou

Re: [GENERAL] Replication

2005-09-13 Thread Tom Lane
"Simon Riggs" <[EMAIL PROTECTED]> writes: >> From: Tatsuo Ishii [mailto:[EMAIL PROTECTED] >> I thought there are some issues of log based replication (I don't >> remeber details though). Have they been resolved recently? > Yes, currently log-file based replication is not recommended when the > tra

Re: [GENERAL] Replication

2005-09-13 Thread Russ Brown
Simon Riggs wrote: Barry, You can use PITR to archive transaction logs to a second server that is kept in standby mode. This will cope with any number of tables and cope with dynamic changes to tables. This is fairly straightforward and very low overhead. Set archive_command to a program that

Re: [GENERAL] Replication

2005-09-13 Thread Csaba Nagy
Well, AFAICT this kind of replication in postgres is not be named "out of the box". Setting up the whole thing to work, and test it to really work reliably is not exactly trivial, and you could have a number of surprises (like when there's little activity, the last WAL stays at the server and so th

[GENERAL] Using COPY command when input file contain backslashes?

2005-09-13 Thread Celia McInnis
I'm wanting to use the COPY command to bulk-load data which may contain backslashes and other special characters, and I want these characters to remain intact.  Right now "\\" becomes "\", and single backslashes are lost (or modify the meaning of the following character). Is there some way (apart f

Re: [GENERAL] Email Verfication Regular Expression

2005-09-13 Thread Steve Atkins
On Tue, Sep 13, 2005 at 12:59:43PM +0200, Stephane Bortzmeyer wrote: > On Wed, Sep 07, 2005 at 12:21:45PM -0700, > Steve Atkins <[EMAIL PROTECTED]> wrote > a message of 26 lines which said: > > > /[EMAIL PROTECTED]@(?:[EMAIL > > PROTECTED])?[a-z0-9-_]+\.(?:a[defgilmnoqrstuwz]|b[abdefghijmnorst

Re: [GENERAL] Replication

2005-09-13 Thread Welty, Richard
Russ Brown wrote: >Apologies for going slighly off topic, but isn't this basically how >MySQL does replication? >Or am I missing something? in the immortal words of mothers everywhere: "if all your friends jumped off of a bridge, would you do it too?" there are a lot of things that are "good

[GENERAL] full outer join performance

2005-09-13 Thread Ben
Are full outer joins expected to perform much worse than inner joins? I'm seeing 2 orders of magnitude difference for an almost identical query. (Well, as "identical" as you can get, comparing a query with an outer join to one without.) This is on 8.0.3, recently analyzed. Here are the explain

Re: [GENERAL] full outer join performance

2005-09-13 Thread Tom Lane
Ben <[EMAIL PROTECTED]> writes: > Are full outer joins expected to perform much worse than inner joins? You're getting burnt by the outer join forcing a bad join order. There's some related discussion here: http://www.postgresql.org/docs/8.0/static/explicit-joins.html reg

Re: [GENERAL] full outer join performance

2005-09-13 Thread Ben
Hrm, as I understand that page, there's not much that can be done about the join order for outer joins. At least, not when there's on 3 tables and 1 outer join involved. Am I missing something? Tom Lane wrote: Ben <[EMAIL PROTECTED]> writes: Are full outer joins expected to perform much wo

[GENERAL] Speed problems

2005-09-13 Thread Warren Bell
I am having problems with performance. I think this is a simple question and I am in the right place, if not, please redirect me. I have a table with 36 fields that slows down quite a bit after some light use. There are only 5 clients connected to this DB and they are doing mostly inserts and upda

Re: [GENERAL] full outer join performance

2005-09-13 Thread Tom Lane
Ben <[EMAIL PROTECTED]> writes: > Hrm, as I understand that page, there's not much that can be done about > the join order for outer joins. At least, not when there's on 3 tables > and 1 outer join involved. Am I missing something? Without knowing what you want the query to do, it's difficult to

Re: [GENERAL] Replication

2005-09-13 Thread Scott Marlowe
On Tue, 2005-09-13 at 10:45, Russ Brown wrote: > Simon Riggs wrote: > > Barry, > > > > You can use PITR to archive transaction logs to a second server that is > > kept in standby mode. > > > > This will cope with any number of tables and cope with dynamic changes > > to tables. > > > > This is f

Re: [GENERAL] Replication

2005-09-13 Thread Peter Eisentraut
Russ Brown wrote: > Apologies for going slighly off topic, but isn't this basically how > MySQL does replication? The PostgreSQL WAL log stores information on the level of "write these bytes to disk", the MySQL replication log stores information on the level of "user called this statement". So

Re: [GENERAL] Speed problems

2005-09-13 Thread Tom Lane
"Warren Bell" <[EMAIL PROTECTED]> writes: > I have a table with 36 fields that slows down quite a bit after some light > use. There are only 5 clients connected to this DB and they are doing mostly > inserts and updates. There is no load on this server or db at all. This > table has had no more tha

Re: [GENERAL] full outer join performance

2005-09-13 Thread Tom Lane
Scott Marlowe <[EMAIL PROTECTED]> writes: > Tom, would that help the planner make better choices for this kind of > query? I think the problem was that he had select ... from a, b full join c on ... where ... where table b is big and you only need a few rows from it, so it really needs t

Re: [GENERAL] Email Verfication Regular Expression

2005-09-13 Thread Peter Eisentraut
Steve Atkins wrote: > If you want to validate email addresses you _must_ check the TLD as > part of the sanity checking, as many of the typos that are > theoretically detectable are detectable by that check. Your requirements may be different than mine, but I often make up "fake" TLDs for testing

Re: [GENERAL] Speed problems

2005-09-13 Thread Scott Marlowe
On Tue, 2005-09-13 at 13:20, Warren Bell wrote: > I am having problems with performance. I think this is a simple question and > I am in the right place, if not, please redirect me. > > I have a table with 36 fields that slows down quite a bit after some light > use. There are only 5 clients conne

Re: [GENERAL] Email Verfication Regular Expression

2005-09-13 Thread Steve Atkins
On Tue, Sep 13, 2005 at 09:02:46PM +0200, Peter Eisentraut wrote: > Steve Atkins wrote: > > If you want to validate email addresses you _must_ check the TLD as > > part of the sanity checking, as many of the typos that are > > theoretically detectable are detectable by that check. > > Your require

Re: [GENERAL] full outer join performance

2005-09-13 Thread Scott Marlowe
On Tue, 2005-09-13 at 13:28, Ben wrote: > Hrm, as I understand that page, there's not much that can be done about > the join order for outer joins. At least, not when there's on 3 tables > and 1 outer join involved. Am I missing something? You might be able to do some kind of thing like: select

Re: [GENERAL] full outer join performance

2005-09-13 Thread Ben
I see. I think I'm going to restructure my logic so I won't have to use the outer join after all, but thanks for the pointers anyway. Tom Lane wrote: Ben <[EMAIL PROTECTED]> writes: Hrm, as I understand that page, there's not much that can be done about the join order for outer joins. At l

Re: [GENERAL] Speed problems

2005-09-13 Thread Ben
When you say VACUUM do you really mean VACUUM ANALYZE? Have you tried a simple ANALYZE? I'm assuming of course that you have indexes that you want to use Warren Bell wrote: I am having problems with performance. I think this is a simple question and I am in the right place, if not, pl

[GENERAL] GNUmed release 0.1 announcement

2005-09-13 Thread Karsten Hilbert
Dear PostgreSQL community, after a few years of planning and coding we can finally announce the release of GNUmed version 0.1. Packages can be found here: http://salaam.homeunix.com/twiki/bin/view/Gnumed/InstallerGuideHome GNUmed is an electronic medical record (EMR) for General Practice and ot

Re: [GENERAL] full outer join performance

2005-09-13 Thread Ben
Tom Lane wrote: I think the problem was that he had select ... from a, b full join c on ... where ... where table b is big and you only need a few rows from it, so it really needs to be joined last, but the above forced doing it first. It wasn't clear to me why he wanted the full join

Re: [GENERAL] Using COPY command when input file contain backslashes?

2005-09-13 Thread Richard Huxton
Celia McInnis wrote: I'm wanting to use the COPY command to bulk-load data which may contain backslashes and other special characters, and I want these characters to remain intact. Right now "\\" becomes "\", and single backslashes are lost (or modify the meaning of the following character). Is

[GENERAL] oracle's first_value function for postgres?

2005-09-13 Thread Ben
Oracle has a very handy function called first_value, which can be used to turn a set like this: a 10 a 3 b 1 c 30 c 10 d 1 d 20 ...into this: a 10 b 1 c 30 d 1 Does postgres have something equivalent, or, even better, is there a reasonable way to express this in standar

[GENERAL] Ranking Results

2005-09-13 Thread Craig
Hi   I have a query that is grouping by 3 fields and returning a sum of another field. I would also like a further field to be returned that shows a ranking for the records based on the sum field. This should really only be a numbering of the rows returned, since I will do the ordering in an

Re: [GENERAL] oracle's first_value function for postgres?

2005-09-13 Thread Stephen Frost
* Ben ([EMAIL PROTECTED]) wrote: > Oracle has a very handy function called first_value, which can be used > to turn a set like this: > > a 10 > a 3 > b 1 > c 30 > c 10 > d 1 > d 20 > > ...into this: > > a 10 > b 1 > c 30 > d 1 > > Does postgres have something equivalent,

Re: [GENERAL] oracle's first_value function for postgres?

2005-09-13 Thread Ben
Sweet, indeed it is. DISTINCT ON seems to be a postgresism, but I can live with that. Thanks. Stephen Frost wrote: Isn't this just: distinct on (col1)? Stephen ---(end of broadcast)--- TIP 4: Have you searched our list archives?

[GENERAL] Code Tables: varchar or serial pkey?

2005-09-13 Thread Peter Fein
Any recommendation on the use of serials vs. varchars as primary keys for code tables? By code table, I mean a small table containing a few application values that is foreign keyed by a table containing user data. I currently have something like: Table "public.education_co

Re: [GENERAL] Replication

2005-09-13 Thread Russ Brown
Scott Marlowe wrote: I don't know, but someone in your organization seems to be. Not just my organisation. I'm afraid this is an opinion I've seen in many places. Let me present it as a simple devil's choice, which would you rather have, proven replication, that works, but requires you to

Re: [GENERAL] oracle's first_value function for postgres?

2005-09-13 Thread Martijn van Oosterhout
On Tue, Sep 13, 2005 at 12:15:21PM -0700, Ben wrote: > Oracle has a very handy function called first_value, which can be used > to turn a set like this: Look at DISTINCT ON () > Does postgres have something equivalent, or, even better, is there a > reasonable way to express this in standard SQL

[GENERAL] Question about PHP and PostgreSQL

2005-09-13 Thread Federico Kereki
Hi! I'm having problems trying to install the PHP module for Apache2. It seems it requires libpq.so.4 but the latest 8.0.3 PostgreSQL version doesn't include it -- though it does include a libpq.so.3. How can I fix this problem? Thanks! Federico Kereki

[GENERAL] Pushing result set to table on different machine?

2005-09-13 Thread Jerry LeVan
Hi, I recently added a linux/windows laptop to our home network. I have started Postgresql (8.0.3) on the laptop and have "replicated" my main database on the laptop. (pg_dump, ftp and pg-"undump"). I would like to keep them reasonably in sync. Slony is overkill and I think the "mirror" contrib

Re: [GENERAL] oracle's first_value function for postgres?

2005-09-13 Thread Tom Lane
Martijn van Oosterhout writes: > On Tue, Sep 13, 2005 at 12:15:21PM -0700, Ben wrote: >> Oracle has a very handy function called first_value, which can be used >> to turn a set like this: > Look at DISTINCT ON () >> Does postgres have something equivalent, or, even better, is there a >> reasonab

Re: [GENERAL] Replication

2005-09-13 Thread Scott Marlowe
On Tue, 2005-09-13 at 15:51, Russ Brown wrote: > Scott Marlowe wrote: > > Let me present it as a simple devil's choice, which would you rather > > have, proven replication, that works, but requires you to setup a > > secondary bit of software / system scripts (like rsync) but is tested > > and pro

Re: [GENERAL] Question about PHP and PostgreSQL

2005-09-13 Thread Scott Marlowe
On Tue, 2005-09-13 at 16:05, Federico Kereki wrote: > Hi! > > I'm having problems trying to install the PHP module for Apache2. > > It seems it requires libpq.so.4 but the latest 8.0.3 PostgreSQL > version doesn't include it -- though it does include a libpq.so.3. > > How can I fix this problem?

Re: [GENERAL] oracle's first_value function for postgres?

2005-09-13 Thread Stephen Frost
* Ben ([EMAIL PROTECTED]) wrote: > Sweet, indeed it is. DISTINCT ON seems to be a postgresism, but I can > live with that. Uhhh, I was pretty sure it was standard SQL... I'd have to go look it up though, to be sure. Don't forget to order by to make sure you get something consistent. :)

[GENERAL] Setting date format for a single output column?

2005-09-13 Thread Michael Schuerig
I'd like to get date columns in the results of a query in the appropriate format (EUROPEAN, GERMAN). I've tried to set DATESTYLE and it works as far as PgSQL is concerned. Unfortunately, though, this confuses the date parsing of the O/R-Mapper I'm using[*]. Is there a way to set the date style

Re: [GENERAL] Setting date format for a single output column?

2005-09-13 Thread Alvaro Herrera
On Wed, Sep 14, 2005 at 02:12:34AM +0200, Michael Schuerig wrote: > > I'd like to get date columns in the results of a query in the > appropriate format (EUROPEAN, GERMAN). I've tried to set DATESTYLE and > it works as far as PgSQL is concerned. Unfortunately, though, this > confuses the date p

Re: [GENERAL] Question about PHP and PostgreSQL

2005-09-13 Thread Matthew Terenzio
On Sep 13, 2005, at 5:05 PM, Federico Kereki wrote: I'm having problems trying to install the PHP module for Apache2. It seems it requires libpq.so.4 but the latest 8.0.3 PostgreSQL version doesn't include it -- though it does include a libpq.so.3. I hope you are getting help from Scott

[GENERAL] MS SQL - PostgreSQL

2005-09-13 Thread Irfan Syukur
Title: MS SQL - PostgreSQL Dear Mailing List member, I have been using MS SQL for a few years and now I am trying to migrate to PostgreSQL. Are there any statements that similir for :    - if [not] exists (select 1 from sysdatabases where name=[db_name]) drop database [db_name]

[GENERAL] "Unsubcribe"

2005-09-13 Thread johan giant
Please...help me.. How to unsubcribe thanks. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ---(end of broadcast)--- TIP 1: if posting/re

Re: [GENERAL] Setting date format for a single output column?

2005-09-13 Thread Michael Schuerig
On Wednesday 14 September 2005 02:32, Alvaro Herrera wrote: > On Wed, Sep 14, 2005 at 02:12:34AM +0200, Michael Schuerig wrote: > > I'd like to get date columns in the results of a query in the > > appropriate format (EUROPEAN, GERMAN). I've tried to set DATESTYLE > > and it works as far as PgSQL i

Re: [GENERAL] MS SQL - PostgreSQL

2005-09-13 Thread Dann Corbit
It is better to send plain text messages instead of html. It is a pain to respond to emails in HTML format. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Irfan Syukur Sent: Tuesday, September 13, 2005 6:31 PM To: POSTGRESQL (E-mail) Subjec

[GENERAL] Partial dates

2005-09-13 Thread Joe
I'm converting a MySQL database to PostgreSQL. Two of the tables have DATE columns which have many "partial" dates. For example, a partial date may be for the publication date of a book, where the date is specified as only the year, e.g., 1957-00-00, and another partial date may be the publica

Re: [GENERAL] Speed problems

2005-09-13 Thread Warren Bell
>On Tue, 2005-09-13 at 13:20, Warren Bell wrote: >> I am having problems with performance. I think this is a simple question and >> I am in the right place, if not, please redirect me. >> >> I have a table with 36 fields that slows down quite a bit after some light >> use. There are only 5 clients

Re: [GENERAL] oracle's first_value function for postgres?

2005-09-13 Thread Tom Lane
Stephen Frost <[EMAIL PROTECTED]> writes: > * Ben ([EMAIL PROTECTED]) wrote: >> Sweet, indeed it is. DISTINCT ON seems to be a postgresism, but I can >> live with that. > Uhhh, I was pretty sure it was standard SQL... Nope, definitely a Postgres-ism. regards, tom lane --

Re: [GENERAL] Partial dates

2005-09-13 Thread Joshua D. Drake
ERROR: date/time field value out of range: "1997-10-00" HINT: Perhaps you need a different "datestyle" setting. CONTEXT: COPY Entry, line 1, column EntryDate: "1997-10-00" I read Appendix B and section 8.5, but I didn't find any way around this, i.e., it seems Postgres insists on complete

Re: [GENERAL] Partial dates

2005-09-13 Thread Tom Lane
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: >> Any suggestions (aside from designing a new datatype)? > Well the easy solution is to just make the date a text type but that is > the wrong answer. The right answer is to fix the data set. > MySQL should never have allowed you do insert those date

Re: [GENERAL] Partial dates

2005-09-13 Thread Joe
Joshua D. Drake wrote: Well the easy solution is to just make the date a text type but that is the wrong answer. The right answer is to fix the data set. MySQL should never have allowed you do insert those dates in the first place. I know that doesn't help you much but at some point you are goi

Re: [GENERAL] MS SQL - PostgreSQL

2005-09-13 Thread Dann Corbit
http://www.postgresql.org/docs/8.0/interactive/sql-createfunction.html > -Original Message- > From: Irfan Syukur [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 13, 2005 8:37 PM > To: Dann Corbit > Subject: RE: [GENERAL] MS SQL - PostgreSQL > > Dear Dann, > > Thanks for your answer.

Re: [GENERAL] Partial dates

2005-09-13 Thread Gnanavel S
On 9/14/05, Joe <[EMAIL PROTECTED]> wrote: Joshua D. Drake wrote:> Well the easy solution is to just make the date a text type but that is> the wrong answer. The right answer is to fix the data set.> MySQL should never have allowed you do insert those dates in the first > place. I know that doesn't

Re: [GENERAL] MS SQL - PostgreSQL

2005-09-13 Thread Tino Wildenhain
Am Mittwoch, den 14.09.2005, 13:02 +0700 schrieb Irfan Syukur: > Dear Tino, > > Thanks for your answer. > > Can PostGreSQL handle dynamic 'stored procedure' whatever that means? :) Postgres stored functions are not fully equivalent to MSSQL stored procedures. Instead you use them just like regul