[GENERAL] pl/pgsql oddity

2004-12-16 Thread Joolz
Hello everyone, When writing some serverside code I ran into an oddity that I managed to boil down to this: --- create or replace function fubar() returns varchar as ' declare l integer; begin l = 38; if l < 38 then return ''< 38'';

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Matteo Beccati
Hi, l = 38; This should be: l := 38; otherwise l would remain uninitialized (NULL). Ciao ciao -- Matteo Beccati http://phpadsnew.com http://phppgads.com ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.pos

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Richard Huxton
Joolz wrote: Hello everyone, When writing some serverside code I ran into an oddity that I managed to boil down to this: elseif l >= 38 then You want "elsif" - plpgsql isn't a hugely sophisticated language and its parser is having trouble there. I'm guessing the parser is somehow putting the "

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Tomasz Myrta
When writing some serverside code I ran into an oddity that I managed to boil down to this: --- create or replace function fubar() returns varchar as ' declare l integer; begin l = 38; if l < 38 then return ''< 38''; elseif l >= 38 the

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Joolz
Ian Barwick zei: > On Thu, 16 Dec 2004 10:06:19 +0100 (CET), Joolz > <[EMAIL PROTECTED]> wrote: >> Hello everyone, >> >> When writing some serverside code I ran into an oddity that I >> managed to boil down to this: >> >> --- >> create or replace

[GENERAL] online backup in critical systems

2004-12-16 Thread Michael Ben-Nes
Hello Im working with postgresql since version 7.0.x and im very very pleased. the DB is incredible and work very well. Lately i been asked to work on a project which require Data safety. means to avid data lost because fail of hardware or software. I thought of Replication or / and dump + log

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Ian Barwick
On Thu, 16 Dec 2004 10:06:19 +0100 (CET), Joolz <[EMAIL PROTECTED]> wrote: > Hello everyone, > > When writing some serverside code I ran into an oddity that I > managed to boil down to this: > > --- > create or replace function fubar() returns v

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Joolz
Richard Huxton zei: Hi Richard, See the other posting, elseif l >= 38 Apparently this is parsed as elseif l >= 38 ^ ^ | | code| | comment from here on It should be "elsif", not "elseif" :-\ Thanks everyone! ---(end of broadcast)

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Neil Conway
Richard Huxton wrote: You want "elsif" - plpgsql isn't a hugely sophisticated language and its parser is having trouble there. I'm guessing the parser is somehow putting the "elseif" branch under the initial "then" so it never gets executed. Indeed; the parser thinks an unrecognized keyword indi

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Csaba Nagy
The only advantage would be that an in-database solution would be OS independent and it could be managed using the same tools which manage the database itself, including the backup and management of it. I'm not sure how the Oracle thing is working, but I suppose you can manage it using plain SQL. T

[GENERAL] Pattern matching a line ending character

2004-12-16 Thread Adam Witney
Hi, I think I have managed to get a line ending character in some of my text fields. If I do a select I get this: array_design_id | gene_identifier | control_name -+---+--- 10 | SC-Calibration_10 (13F24) | SC-Calib

[GENERAL] Pattern matching a line ending character... Please ignore previous message, solved!

2004-12-16 Thread Adam Witney
As usual jumped the gun on my message, solved it... Its '%\r' Thanks adam -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ---(end of broadcast)--- TIP 6: Have you searched our lis

[GENERAL] Serial column has suddenly stopped working

2004-12-16 Thread Malcolm Warren
I have been using a serial column in my most important postgres table for a couple of years. But today it has suddenly started assigning zero instead of the next number, which clearly is causing chaos. I have restarted Postgres, but it has not solved the problem. I cannot re-assign the serial n

[GENERAL] DB Slowing Down

2004-12-16 Thread Alex
Hi, we have a database. not to big about 50 tables, 20m records. On a daily basis we update/insert/delete between 500k to 1M records in total. We run a full vacuum every night. The db grows probably by 200k records each day and at the end of the month it gets cleaned up. We run 7.4.1 and 7.4.6

Re: [GENERAL] Serial column has suddenly stopped working

2004-12-16 Thread Richard Huxton
Malcolm Warren wrote: I have been using a serial column in my most important postgres table for a couple of years. But today it has suddenly started assigning zero instead of the next number, which clearly is causing chaos. I have restarted Postgres, but it has not solved the problem. I cannot

Re: [GENERAL] DB Slowing Down

2004-12-16 Thread Richard Huxton
Alex wrote: Hi, we have a database. not to big about 50 tables, 20m records. On a daily basis we update/insert/delete between 500k to 1M records in total. We run a full vacuum every night. The db grows probably by 200k records each day and at the end of the month it gets cleaned up. We run 7.4.1

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Michael Ben-Nes
I think and please correct me that Postgres loves RAM, the more the better. Any way RAID5 is awful with writing, go with RAID1 ( mirroring ) I use Debian Sarge and im very happy. Perl is very slow, maybe you can use PHP ? Alex wrote: Hi, we are planning to upgrade our servers but deciding on the r

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Bruno Wolff III
On Thu, Dec 16, 2004 at 10:47:46 +0100, Csaba Nagy <[EMAIL PROTECTED]> wrote: > The only advantage would be that an in-database solution would be OS > independent and it could be managed using the same tools which manage > the database itself, including the backup and management of it. I'm not >

Re: [GENERAL] DB Slowing Down

2004-12-16 Thread Richard Huxton
Alex wrote: It a gradual process. For example, we have 3 reference tables that get updated very day. they have between 3,5 and 7M records. All we do is simple inserts, deletes. The number of records is different each day so its a bit difficult to say. Another table is a price database. This is

[GENERAL] 7.1.3: dataloss: FATAL 2: XLogFlush: request is not satisfied

2004-12-16 Thread peter pilsl
We had a servercrash the other night and while none of the datadisks was affected, the db-server (7.1.3) is not starting again: Dec 16 14:48:44 alpha postgres[12432]: [1] DEBUG: database system shutdown was interrupted at 2004-12-16 14:46:30 CET Dec 16 14:48:44 alpha postgres[12432]: [2] DEBUG:

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Geoffrey
Bruno Wolff III wrote: cron isn't really part of the OS. Up until 8.0, any OS that Postgres ran on had cron. I have seen claims that there is a version of cron that runs under windows, but haven't verified that. Given this I don't see how a dependence on cron is going to cause you portability probl

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Richard Huxton
Michael Ben-Nes wrote: I think and please correct me that Postgres loves RAM, the more the better. Certainly for disk-cache. Any way RAID5 is awful with writing, go with RAID1 ( mirroring ) Raid 10 seems to be the consensus if you have enough disks. See the archives of the performance list for pl

Re: [GENERAL] bytea internal encoding

2004-12-16 Thread Ron Peterson
On Wed, Dec 15, 2004 at 10:22:07PM -0700, Michael Fuhr wrote: > On Wed, Dec 15, 2004 at 11:08:29PM -0500, Ron Peterson wrote: > > > How are bytea values encoded internally? > > > > Or maybe a better question would be what is the proper way to access > > bytea data from within a C function? Are t

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Csaba Nagy
No doubt about this, there are a lot of features which are way more important, but this was not the point at all. The question was if there is any advantage of having it in the DB, and the answer is: yes there is some advantage. It's a totally different problem how important it is - there are many

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Riccardo G. Facchini
--- Bruno Wolff III <__> wrote: > On Thu, Dec 16, 2004 at 10:47:46 +0100, > Csaba Nagy <[EMAIL PROTECTED]> wrote: > > The only advantage would be that an in-database solution would be > OS > > independent and it could be managed using the same tools which > manage > > the database itself, inclu

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Alex
Hmm... I read that Raid5 is suggested over Raid1. Also HW vendors told us that. Php :-) is not an option and I dont believe Perl is a bottleneck as well. Michael Ben-Nes wrote: I think and please correct me that Postgres loves RAM, the more the better. Any way RAID5 is awful with writing, go wit

Re: [GENERAL] 7.1.3: dataloss: FATAL 2: XLogFlush: request is not satisfied

2004-12-16 Thread Alvaro Herrera
On Thu, Dec 16, 2004 at 02:56:12PM +0100, peter pilsl wrote: > I did a new initdb and recovered from the backup, but there is one minor > database that was not in the backup for weeks (blame me), so I would be > very happy if there is way to start postgres on the old datadir and > retrieve the

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Scott Marlowe
On Thu, 2004-12-16 at 06:39, Michael Ben-Nes wrote: > I think and please correct me that Postgres loves RAM, the more the better. > > Any way RAID5 is awful with writing, go with RAID1 ( mirroring ) With battery backed cache and a large array, RAID 5 is quite fast, even with writes. Plus with a

Re: [GENERAL] DB Slowing Down

2004-12-16 Thread Geoffrey
Alex wrote: Thanks for the suggestions. I run a vaccum analyze every night. I will look into all the options you suggested. And please post back your results as there are others who are interested in this thread. :) -- Until later, Geoffrey ---(end of broadcast)--

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Geoffrey
Alex wrote: Hmm... I read that Raid5 is suggested over Raid1. Also HW vendors told us that. Php :-) is not an option and I dont believe Perl is a bottleneck as well. Why would your HW vendor be stipulating the software you use? -- Until later, Geoffrey ---(end of broadcast)-

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Tom also suggested just adding 'elseif' as an alternative for 'elsif'. > That sounds like it would be worth doing. I think we should go ahead and do that for 8.0. I'm getting tired of reading reports that stem from this mistake (I think this is the third

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Keith C. Perry
Quoting Scott Marlowe <[EMAIL PROTECTED]>: > On Thu, 2004-12-16 at 06:39, Michael Ben-Nes wrote: > > I think and please correct me that Postgres loves RAM, the more the > better. > > > > Any way RAID5 is awful with writing, go with RAID1 ( mirroring ) > > With battery backed cache and a large a

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Geoffrey
Tom Lane wrote: Neil Conway <[EMAIL PROTECTED]> writes: Tom also suggested just adding 'elseif' as an alternative for 'elsif'. That sounds like it would be worth doing. I think we should go ahead and do that for 8.0. I'm getting tired of reading reports that stem from this mistake (I think this

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Steve Atkins
On Thu, Dec 16, 2004 at 10:12:46AM +0100, Marco Colombo wrote: > On Wed, 15 Dec 2004, Jim C. Nasby wrote: > > >No, PostgreSQL doesn't have an equivalent to Oracle's dbms_job, but this > >is a question that comes up pretty often. I think the bulk of the work > >to make this happen could be done out

[GENERAL] use pg_catalog for foreign key constraint

2004-12-16 Thread Jonathan Hedstrom
Does anyone know if it is possible to use system catalogs in foreign key constraints in Postgres 7.4.1? My sample table: * CREATE TABLE tbl_reference ( reference_id SERIAL PRIMARY KEY, from_table NAME NOT NULL REFERENCES pg_catalog.pg_class(relname), from_id INTEGER, to_table NAME NOT NULL REFERE

Re: [GENERAL] use pg_catalog for foreign key constraint

2004-12-16 Thread Tom Lane
Jonathan Hedstrom <[EMAIL PROTECTED]> writes: > Does anyone know if it is possible to use system catalogs in foreign key > constraints in Postgres 7.4.1? It's not. The system wouldn't enforce the constraint even if you overrode the permission check, because internal backend catalog updates don't

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Geoffrey
Tom Lane wrote: Geoffrey <[EMAIL PROTECTED]> writes: I don't know of any other language that permits multiple spellings for the same construct. I'd be concerned with starting such a precedent. Well, we have plenty of precedent already at the SQL language level: ANALYZE vs ANALYSE, NOTNULL vs IS

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Guy Rouillier
Michael Fuhr wrote: > On Thu, Dec 16, 2004 at 12:27:53PM -0500, Geoffrey wrote: > >> I don't know of any other language that permits multiple spellings >> for the same construct. I'd be concerned with starting such a >> precedent. > > I'd be in favor of making it a bloody law that every bloody

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Frank D. Engel, Jr.
"elsif" is the spelling used by Ada. I'm getting rather used to it, myself. I'm really starting to like Ada. So "elsif" is fine with me. As far as alternate spellings being accepted within a language, look at the Transcript language used by Runtime Revolution (www.runrev.com), which is a so-c

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Richard_D_Levine
I prefer the FORTRAN66 construct IF where it jumps to label1 if is negative, label2 if zero, and label3 if positive. No else ifs about it. I hope you realize I'm as kidding as I am obviously too old.

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Clodoaldo Pinto
--- Tom Lane <[EMAIL PROTECTED]> escreveu: > Neil Conway <[EMAIL PROTECTED]> writes: > > Tom also suggested just adding 'elseif' as an alternative for 'elsif'. > > That sounds like it would be worth doing. > > I think we should go ahead and do that for 8.0. I'm getting tired of > reading repor

[GENERAL] Non-aggregate values attached to aggregates?

2004-12-16 Thread Benjamin Smith
I have a list of students, and a list of enrollment records, and I'm trying to get a list of students and their most recent enrollment/disenrollment dates. create table students (id serial primary key, name varchar); create table enrollments ( students_id integer not null references stud

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Greg Stark
Csaba Nagy <[EMAIL PROTECTED]> writes: > The only advantage would be that an in-database solution would be OS > independent That kind of argument leads to monstrosities like Oracle that reimplement everything they can from the OS. What would be a neat project is if someone wrote a cron implem

Re: [GENERAL] Non-aggregate values attached to aggregates?

2004-12-16 Thread Tom Lane
Benjamin Smith <[EMAIL PROTECTED]> writes: > I have a list of students, and a list of enrollment records, and I'm trying > to > get a list of students and their most recent enrollment/disenrollment dates. I don't know any nice way to solve this type of problem in bog-standard SQL. But it's pret

Re: [GENERAL] Non-aggregate values attached to aggregates?

2004-12-16 Thread Michael Fuhr
On Thu, Dec 16, 2004 at 01:38:19PM -0800, Benjamin Smith wrote: > I have a list of students, and a list of enrollment records, and I'm trying > to > get a list of students and their most recent enrollment/disenrollment dates. If you don't mind using a non-standard construct, see the documentat

[GENERAL] tsearch2 avoiding firing of triggers.....

2004-12-16 Thread Net Virtual Mailing Lists
For some reason, I feel as though I have asked this before but I can't find it anywhere. I hope it is not repetitive! I have various triggers and rules in my database, mostly for keeping tsearch2 updated and (now) materialized views. I'd say probably 90% of the updates to my database do not

[GENERAL] MD5

2004-12-16 Thread Jamie Deppeler
Hi, I was just wondering is it possible to encrypt a filed in the database with md5? i know it is possible to do it with DB users ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister You

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Bruno Wolff III
On Thu, Dec 16, 2004 at 15:34:03 -0500, [EMAIL PROTECTED] wrote: > I prefer the FORTRAN66 construct > > IF My memory is that those labels were separated by commas. > > where it jumps to label1 if is negative, label2 if zero, and > label3 if positive. No else ifs about it. > > I hope yo

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Frank D. Engel, Jr.
Since when is COBOL dead ;-) Can't say I know that language yet, actually (I did know some Fortran, but it's been a while)... Just because a language is not in common use does not mean it lacks value. Some ideas are so far ahead of their time, they get laughed off for a time, then suddenly bec

Re: [GENERAL] MD5

2004-12-16 Thread Jamie Deppeler
Tino Wildenhain wrote: Hi, Am Freitag, den 17.12.2004, 09:41 +1100 schrieb Jamie Deppeler: Hi, I was just wondering is it possible to encrypt a filed in the database with md5? i know it is possible to do it with DB users No. You cannot encrypt with md5 because you can

Re: [GENERAL] MD5

2004-12-16 Thread Chris Smith
Use the md5 function: select md5('welcome'); md5 -- 40be4e59b9a2a2b5dffb918c0e86b3d7 (1 row) Regards, Chris Smith Suite 30, 45-51 Huntley St, Alexandria, NSW 2015 Australia Ph: +61 2 9517 2505 Fx: +61 2 9517 1915 email: [EMAIL PROTECTED] web: www.inte

Re: [GENERAL] MD5

2004-12-16 Thread Chris Smith
(Ignore my other reply.. ;P) You'll need to import the pgcrypto.sql file (this creates the functions for you). Read the doco on how to install the extension, it should tell you where the sql file is. Regards, Chris Smith Suite 30, 45-51 Huntley St, Alexandria, NSW 2015 Australia Ph: +61 2 9517

[GENERAL] sorting problem

2004-12-16 Thread Jamie Deppeler
Problem i am having at the moment i cant get a true alpha sort to work as Order By is sorting A..Z then a..z where i need aA..zZ sort independant of case. SQL Query SELECT * FROM person WHERE (salutation LIKE '%To%') ORDER BY person.lastname Results Ahsteit Bloggs Cap Carrey Diver Duckula Golds

Re: [GENERAL] MD5

2004-12-16 Thread Michael Fuhr
[Please don't post in HTML] On Fri, Dec 17, 2004 at 10:55:47AM +1100, Jamie Deppeler wrote: > Well basically i want to store and hashed value that will never be > changed just compaired too hashed values In that case MD5 should suffice, although recently-discovered weaknesses have led some peopl

Re: [GENERAL] MD5

2004-12-16 Thread Tino Wildenhain
Am Freitag, den 17.12.2004, 10:55 +1100 schrieb Jamie Deppeler: > Tino Wildenhain wrote: > > Hi, > > > > Am Freitag, den 17.12.2004, 09:41 +1100 schrieb Jamie Deppeler: > > > > > Hi, > > > > > > I was just wondering is it possible to encrypt a filed in the database > > > with md5? i know it

Re: [GENERAL] sorting problem

2004-12-16 Thread Peter Eisentraut
Jamie Deppeler wrote: > Problem i am having at the moment i cant get a true alpha sort to > work as Order By is sorting A..Z then a..z where i need aA..zZ sort > independant of case. Initialize the database cluster with a locale setting other than "C". -- Peter Eisentraut http://developer.postgr

Re: [GENERAL] sorting problem

2004-12-16 Thread Michael Fuhr
On Fri, Dec 17, 2004 at 01:45:36AM +0100, Peter Eisentraut wrote: > Jamie Deppeler wrote: > > Problem i am having at the moment i cant get a true alpha sort to > > work as Order By is sorting A..Z then a..z where i need aA..zZ sort > > independant of case. > > Initialize the database cluster with

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Alex
The comment about HW vendor was regarding Raid configuration not the software. Geoffrey wrote: Alex wrote: Hmm... I read that Raid5 is suggested over Raid1. Also HW vendors told us that. Php :-) is not an option and I dont believe Perl is a bottleneck as well. Why would your HW vendor be stipul

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Alex
We use perl for the heavy batch jobs, the web interface is written using JSP / applets. If we would change these then it would be Java or C. But all the heavy stuff is handled by Stored Procedures so I dont see a real need for a change. I actually am more interested to hear if there are an rec

Re: [GENERAL] Non-aggregate values attached to aggregates?

2004-12-16 Thread Michael Fuhr
On Thu, Dec 16, 2004 at 03:21:35PM -0800, Benjamin Smith wrote: > On Thursday 16 December 2004 14:09, Michael Fuhr wrote: > > > Dates are kept as ]MMDD', eg 2004114 for Nov 14, 2004. > > > > Why not use a DATE type? You can reformat it with to_char() if > > need be. > > Not a bad idea. I us

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Christopher Browne
After a long battle with technology, [EMAIL PROTECTED] (Greg Stark), an earthling, wrote: > This wouldn't really be a part of Postgres though, just another > application using Postgres. It could be something Postgres could > recommend for people who find cron too awkward for their > application.

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Neil Conway
On Thu, 2004-12-16 at 11:09 -0500, Tom Lane wrote: > I think we should go ahead and do that for 8.0. I'm getting tired of > reading reports that stem from this mistake (I think this is the third > one in the past month ...). I can't see any real downside to accepting > both spellings, can you? I

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Geoffrey
Alex wrote: The comment about HW vendor was regarding Raid configuration not the software. My apologies, misread your post. Geoffrey wrote: Alex wrote: Hmm... I read that Raid5 is suggested over Raid1. Also HW vendors told us that. Php :-) is not an option and I dont believe Perl is a bottleneck

Re: [GENERAL] Debian Packages for Postgresql 8.0.0 RC1

2004-12-16 Thread Greg Stark
Chris Smith <[EMAIL PROTECTED]> writes: > I doubt you'll find any for an RC release... when 8 is released (final), then > I > think you'll find them. Usually packages for things like beta or RC releases would show up in experimental if there were any. You might have to add a line like this to y

Re: [GENERAL] sorting problem

2004-12-16 Thread Greg Stark
Chris Smith <[EMAIL PROTECTED]> writes: > Would doing it this way require an index: > > create index lower_lastname on table x lower(lastname); Well it doesn't *require* but it may be a good idea. It depends on your queries. It will NOT be useful for a query like: select * from x order by lowe

Re: [GENERAL] MD5

2004-12-16 Thread Tino Wildenhain
Hi, Am Freitag, den 17.12.2004, 09:41 +1100 schrieb Jamie Deppeler: > Hi, > > I was just wondering is it possible to encrypt a filed in the database > with md5? i know it is possible to do it with DB users No. You cannot encrypt with md5 because you cant decrypt. md5 is a hash function. But you

Re: [GENERAL] Non-aggregate values attached to aggregates?

2004-12-16 Thread Klint Gore
On Thu, 16 Dec 2004 13:38:19 -0800, Benjamin Smith <[EMAIL PROTECTED]> wrote: > I have a list of students, and a list of enrollment records, and I'm trying > to > get a list of students and their most recent enrollment/disenrollment dates. just subselect the max date for the student_id in the w

Re: [GENERAL] tsearch2 avoiding firing of triggers.....

2004-12-16 Thread Michael Fuhr
On Thu, Dec 16, 2004 at 02:21:22PM -0800, Net Virtual Mailing Lists wrote: > I have various triggers and rules in my database, mostly for keeping > tsearch2 updated and (now) materialized views. I'd say probably 90% of > the updates to my database do not require these triggers/rules to fire > off

[GENERAL] Debian PLPython

2004-12-16 Thread Simon Wittber
Hi Chaps, I'm still learning, so please be patient. I recently installed 8.0.0 RC1 on my windows machine. The languages node (in pgadmin) listed two languages, one being plpython. I've now installed 7.4 on our debian server, but it appears not to come with plpython installed. I am unable to find

Re: [GENERAL] Non-aggregate values attached to aggregates?

2004-12-16 Thread Benjamin Smith
Thanks much for your help! It took a few tries to get what it was all about, but I got it. On Thursday 16 December 2004 14:09, Michael Fuhr wrote: > > Dates are kept as ]MMDD', eg 2004114 for Nov 14, 2004. > > Why not use a DATE type? You can reformat it with to_char() if > need be. Not

Re: [GENERAL] Debian PLPython

2004-12-16 Thread Tom Lane
Simon Wittber <[EMAIL PROTECTED]> writes: > I've now installed 7.4 on our debian server, but it appears not to > come with plpython installed. Should be there, though you may need an auxiliary package. I'm not sure how Debian splits things up, but in RPM-based distributions it's in a postgresql-p

Re: [GENERAL] Debian PLPython

2004-12-16 Thread Greg Stark
Simon Wittber <[EMAIL PROTECTED]> writes: > I've now installed 7.4 on our debian server, but it appears not to > come with plpython installed. It does to, you should have a files like: bash-3.00$ ls -l /usr/lib/postgresql/lib/pl*.so -rw-r--r-- 1 root root 32896 Dec 1 04:19 /usr/lib/postgresq

Re: [GENERAL] Debian PLPython

2004-12-16 Thread Simon Wittber
> > createlang -d databasename plpython > excellent, that does the trick. thankyou. I guess I was confused, as the langauges came 'pre-created' on the 8.0 RC1 windows install. ---(end of broadcast)--- TIP 7: don't forget to increase your free spa

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Marco Colombo
On Wed, 15 Dec 2004, Jim C. Nasby wrote: No, PostgreSQL doesn't have an equivalent to Oracle's dbms_job, but this is a question that comes up pretty often. I think the bulk of the work to make this happen could be done outside of the core database, so it seems a good candidate for pgfoundry. What's

Re: [GENERAL] Insert do not work in my case

2004-12-16 Thread Richard Huxton
Mickael Remond wrote: Chris Smith wrote: The easiest way to start is to turn on query logs for your server and see if it gets that far. When turning on query logs in Postgresql, I only get the content of the prepared statement without the parameters (question mark). I there a way to expand what

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Joolz
Tomasz Myrta zei: >> When writing some serverside code I ran into an oddity that I >> managed to boil down to this: >> >> --- >> create or replace function fubar() returns varchar as ' >> declare >> l integer; >> begin >> l = 38; >> if l <

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Richard Huxton
Matteo Beccati wrote: Hi, l = 38; This should be: l := 38; otherwise l would remain uninitialized (NULL). Actually, either work. You are right that the docs suggest the second form though. -- Richard Huxton Archonet Ltd ---(end of broadcast)-

[GENERAL] What HW / OS is recommeded

2004-12-16 Thread Alex
Hi, we are planning to upgrade our servers but deciding on the right configuration seems to be quite difficult. As for the system. About 50 tables, 20M records and growing about 500k-1m per month. The systems mostly loads data from files (perl batch jobs). And generates client files. Jobs gener

Re: [GENERAL] Help needed with QueryPlan

2004-12-16 Thread Alex
Richard, thanks for the reply. I actually did what you suggested but still the same. Now i set ENABLE_SEQSCAN=false in the perl script which works but I dont think thats the way it shold be done. Alex Richard Huxton wrote: Alex wrote: Hi, I have a query that runs pretty slow and tried to use exp

Re: [GENERAL] DB Slowing Down

2004-12-16 Thread Alex
It a gradual process. For example, we have 3 reference tables that get updated very day. they have between 3,5 and 7M records. All we do is simple inserts, deletes. The number of records is different each day so its a bit difficult to say. Another table is a price database. This is where we act

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Csaba Nagy
Well, if you program in Java for example, it is a portability problem to call any native programs. It doesn't matter at all that the program itself is portable, it is just not portable enough to call it at all, not to mention other robustness problems arising from the Java-native interaction. Compl

Re: [GENERAL] What HW / OS is recommeded

2004-12-16 Thread Geoffrey
Michael Ben-Nes wrote: I think and please correct me that Postgres loves RAM, the more the better. Any way RAID5 is awful with writing, go with RAID1 ( mirroring ) I use Debian Sarge and im very happy. Perl is very slow, maybe you can use PHP ? I find perl perfectly acceptable. I would appreciate

Re: [GENERAL] Serial column has suddenly stopped working

2004-12-16 Thread Malcolm Warren
The answer is 3. Mistake of mine. I put in a field of the same name to display it, and it was also sending 0 with the statement. Thank you for helping me get to the bottom of it. Malcolm Warren Richard Huxton wrote: Malcolm Warren wrote: Thank you for your reply. Yes, I get the next number and th

Odd error with FK referencing another FK column? (was Re: [GENERAL] java.sql.SQLException: ERROR: Relation 38868974 does not exist)

2004-12-16 Thread Richard Huxton
Alain M. Gaudrault wrote: We had a foreign key which was referencing a column in table which itself was a foreign key (something that was new to our system). We've made mods to prevent the two levels of foreign keys, and so far, so good. Not sure how this would explain the behaviour we were se

Re: [GENERAL] DB Slowing Down

2004-12-16 Thread Alex
Thanks for the suggestions. I run a vaccum analyze every night. I will look into all the options you suggested. Thanks Alex Richard Huxton wrote: Alex wrote: It a gradual process. For example, we have 3 reference tables that get updated very day. they have between 3,5 and 7M records. All we do

Re: [GENERAL] Scheduler in Postgres

2004-12-16 Thread Geoffrey
Csaba Nagy wrote: No doubt about this, there are a lot of features which are way more important, but this was not the point at all. The question was if there is any advantage of having it in the DB, and the answer is: yes there is some advantage. It's a totally different problem how important it is

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Tom Lane
Geoffrey <[EMAIL PROTECTED]> writes: > I don't know of any other language that permits multiple spellings for > the same construct. I'd be concerned with starting such a precedent. Well, we have plenty of precedent already at the SQL language level: ANALYZE vs ANALYSE, NOTNULL vs IS NOT NULL, an

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Michael Fuhr
On Thu, Dec 16, 2004 at 12:27:53PM -0500, Geoffrey wrote: > I don't know of any other language that permits multiple spellings for > the same construct. I'd be concerned with starting such a precedent. I'd be in favor of making it a bloody law that every bloody language use the same bloody spel

Re: [GENERAL] Postgres not using shared memory

2004-12-16 Thread Karl O. Pinc
On 2004.12.10 15:30 Doug McNaught wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > Hi, > > I can't seem to get postgresql to use shared memory and performance is > terrrible. 1) Linux doesn't track shared pages (which is not the same as shared memory) anymore--the field the in 'free' output i

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Martijn van Oosterhout
On Thu, Dec 16, 2004 at 05:14:42PM -0300, Clodoaldo Pinto wrote: > --- Tom Lane <[EMAIL PROTECTED]> escreveu: > > Neil Conway <[EMAIL PROTECTED]> writes: > > > Tom also suggested just adding 'elseif' as an alternative for 'elsif'. > > > That sounds like it would be worth doing. > > > > I think

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Richard_D_Levine
Don't get used to Ada. It's almost as dead as COBOL, though I liked it too for some things. Oracle plsql is s Ada-like I've literally cut and pasted whole Ada routines into Oracle plsql and they work without modification. PostgreSQL doesn't do parameters and packages, so it is slightly more

Re: [GENERAL] Debian Packages for Postgresql 8.0.0 RC1

2004-12-16 Thread Chris Smith
I doubt you'll find any for an RC release... when 8 is released (final), then I think you'll find them. Regards, Chris Smith Suite 30, 45-51 Huntley St, Alexandria, NSW 2015 Australia Ph: +61 2 9517 2505 Fx: +61 2 9517 1915 email: [EMAIL PROTECTED] web: www.interspire.com Simon Wittber wrote: Des

Re: [GENERAL] MD5

2004-12-16 Thread Michael Fuhr
On Fri, Dec 17, 2004 at 09:41:22AM +1100, Jamie Deppeler wrote: > I was just wondering is it possible to encrypt a filed in the database > with md5? i know it is possible to do it with DB users MD5 returns a hash, not an encrypted string that could later be decrypted. For an encryption mechanis

Re: [GENERAL] sorting problem

2004-12-16 Thread Michael Fuhr
On Fri, Dec 17, 2004 at 11:28:36AM +1100, Jamie Deppeler wrote: > Problem i am having at the moment i cant get a true alpha sort to work > as Order By is sorting A..Z then a..z where i need aA..zZ sort > independant of case. ORDER BY LOWER(person.lastname) or ORDER BY UPPER(person.lastname)

Re: [GENERAL] sorting problem

2004-12-16 Thread Chris Smith
Would doing it this way require an index: create index lower_lastname on table x lower(lastname); ? Regards, Chris Smith Suite 30, 45-51 Huntley St, Alexandria, NSW 2015 Australia Ph: +61 2 9517 2505 Fx: +61 2 9517 1915 email: [EMAIL PROTECTED] web: www.interspire.com Michael Fuhr wrote: On Fri, De