[GENERAL] how can I create the DML for an existing database - within an application

2006-04-12 Thread Harald Armin Massa
I want to get the output frompg_dump --struct-only --table=whateverinside a programm. Of course I could call pg_dump in a seperate process and capture the output and all; but ...as PGAdmin is doing it someway, I strongly suspect there is a kind of call to recreate the DML language from a table in t

Re: [GENERAL] Truncate and Foreign Key Constraint question

2006-04-12 Thread Gregory S. Williamson
Doh ! A test schema that was a left over. Thanks for the sanity check ... as usual, pilot error! g -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Wed 4/12/2006 10:02 PM To: Gregory S. Williamson Cc: pgsql-general@postgresql.org Subject:Re: [GENERAL

Re: [GENERAL] Select first ten of each category?

2006-04-12 Thread Yanni Chiu
Michael Glaesemann wrote: Without using UNION, (which would require writing a select statement for each category), how would LIMIT allow him to do this for each category in a single query? You're right, it would need a UNION, and a SELECT per category. So there'd be another SELECT to find al

Re: [GENERAL] Truncate and Foreign Key Constraint question

2006-04-12 Thread Tom Lane
"Gregory S. Williamson" <[EMAIL PROTECTED]> writes: > As the sequence below shows, I dropped the FK constraint successfully, but > when I run TRUNCATE collections_l it says: > ERROR: cannot truncate a table referenced in a foreign key constraint > DETAIL: Table "client_collect_rates" references

[GENERAL] Truncate and Foreign Key Constraint question

2006-04-12 Thread Gregory S. Williamson
This is in postgres 8.1: PostgreSQL 8.1.1 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) I've got a table in one schema (work.client_collect_rates) which has an FK constraint with a table, content.collections_l (definitions shown below). There's a

Re: [GENERAL] Select first ten of each category?

2006-04-12 Thread Michael Glaesemann
On Apr 13, 2006, at 11:08 , Yanni Chiu wrote: Benjamin Smith wrote: It has a LARGE number of entries. I'd like to grab the 10 most expensive items from each category in a single query. How can this be done? Use a LIMIT on your SELECT. See: http://www.postgresql.org/docs/8.1/static/queries

Re: [GENERAL] Select first ten of each category?

2006-04-12 Thread Michael Glaesemann
On Apr 13, 2006, at 10:16 , Benjamin Smith wrote: I'm stumped on this one... I have a table defined thusly: create table items ( id serial, category integer not null references category(id), name varchar not null, price real, unique(category, name)); It has a LARGE number of entries. I'd lik

Re: [GENERAL] Select first ten of each category?

2006-04-12 Thread Yanni Chiu
Benjamin Smith wrote: It has a LARGE number of entries. I'd like to grab the 10 most expensive items from each category in a single query. How can this be done? Use a LIMIT on your SELECT. See: http://www.postgresql.org/docs/8.1/static/queries-limit.html ---(end of bro

[GENERAL] Select first ten of each category?

2006-04-12 Thread Benjamin Smith
I'm stumped on this one... I have a table defined thusly: create table items ( id serial, category integer not null references category(id), name varchar not null, price real, unique(category, name)); It has a LARGE number of entries. I'd like to grab the 10 most expensive items from ea

Re: [GENERAL] Leverage your PostgreSQL V8.1 skills to learn DB2

2006-04-12 Thread Merlin Moncure
On 4/12/06, Scott Marlowe <[EMAIL PROTECTED]> wrote: > > Actually, after reading that page, I'm don't think DB2 came off as being > much better than PostgreSQL. > > The postgres database is new to 8.1, I believe. I think it was as much I think the article should have been titled: 'why you dont re

Re: [GENERAL] How to import a CSV file (originally from Excel)

2006-04-12 Thread Craig White
On Wed, 2006-04-12 at 17:57 +0200, Magnus Hagander wrote: > > > \copy "Flight Traffic" from yourfile.csv delimiter as ',' > > csv quote as > > > '"' > > > > > > (might need some adaption, of course) > > > > > > > > > Loading 45,000 lines is trivial for copy, it shouldn't take > > noticable >

[GENERAL] Initdb problem installing 8.1.3-1 on winXP

2006-04-12 Thread Ryan
I have been running 8.0 on this Windows XP machine for some time now without problem. I decided I would upgrade the machine to 8.1 before starting my next project. I tried running the upgrade.bat file that comes with 8.1 however it failed to run for some reason or another. Instead I uninstalled 8.0

[GENERAL] IA64 RPMs for 8.1.3

2006-04-12 Thread Devrim GUNDUZ
Hi, I've just built 8.1.3 RPMs for IA64. The platform is Red Hat Enterprise Linux Advanced Server 4 for Itanium. The RPMs should be on main FTP site very soon. I'll upload 8.0.7 binaries tomorrow. Please let me know if you have problems with these binaries. Regards, -- The PostgreSQL Company

[GENERAL] IA64 RPMs for 8.1.3

2006-04-12 Thread Devrim GUNDUZ
Hi -- The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: PL/php, plPerlNG - http://www.commandprompt.com/ ---(end of broadcast)---

Re: [GENERAL] pg_restore --schema always returns an empty dump

2006-04-12 Thread Tom Lane
Nick Johnson <[EMAIL PROTECTED]> writes: > using "pg_restore db.dump", as expected, returns the entire dump. > However, "pg_restore --schema foo db.dump", where 'foo' is the name of a > schema present in the database dump always returns an empty dump. > "pg_restore --schema foo --table bar" retu

Re: [GENERAL] Performance UPDATE/INSERT

2006-04-12 Thread codeWarrior
Turn off your indices on the table... do the inserts... do the updates... rebuild the indices       ""MG"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... Hello,   I have about 100 000 records, which need about 30 minutes to write them with single INSERTs into

Re: [GENERAL] "Hidden" field for each column

2006-04-12 Thread codeWarrior
You can specifiy a "comment" on each field "Don Y" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > Is there any way that I can consistently (across all > tables) add a parameter defining "what" each column > "is"? (sorry, crappy grammar and ill-formed question). > > I

Re: [GENERAL] Evaluating client processes vs stored procedures

2006-04-12 Thread codeWarrior
During your process loop -- when / where are the updates committed ? all at the end ? How may rows (approx) are you updating ? FWIW: I think you will probably find that it is NOT the SQL update that is your bottleneck I am inclined to speculate that the performance issue is related to the

[GENERAL] pg_restore --schema always returns an empty dump

2006-04-12 Thread Nick Johnson
If I create a complete database dump in custom or tar format, with a command like the following: pg_dump -Fc dbname > db.dump using "pg_restore db.dump", as expected, returns the entire dump. However, "pg_restore --schema foo db.dump", where 'foo' is the name of a schema present in the databas

Re: [GENERAL] "Hidden" field for each column

2006-04-12 Thread Tom Lane
Don Y <[EMAIL PROTECTED]> writes: > I want to be able to embed in the database parameters > that tell it how to interpret each column. In other > words, while the TYPE for two columns might be > text/char/varchar/etc., the data that each contained > could have vastly different interpretations. If

Re: [GENERAL] postmaster.pid

2006-04-12 Thread Tom Lane
"Ian Harding" <[EMAIL PROTECTED]> writes: > The docs state that postmaster.pid is "A lock file recording the > current postmaster PID and shared memory segment ID (not present after > postmaster shutdown" > I never looked until now, but I see the number 5432001 where the pid > should be, and the re

[GENERAL] Evaluating client processes vs stored procedures

2006-04-12 Thread Tim Hart
List, I have a client process that is causing some performance issues with my app. On my current platform, the standard automated profiling tools are not available. Consequently, I can't easily determine where the bottleneck is in the process. I have an inkling that rewriting the client process

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Scott Marlowe
On Wed, 2006-04-12 at 13:53, Ted Byers wrote: > - Original Message - > From: "Scott Marlowe" <[EMAIL PROTECTED]> > > > > There have been NUMEROUS discussions of RAID-5 versus RAID 1+0 in the > > perform group in the last year or two. Short version: > > > Interesting. SNIP > This questio

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Merlin Moncure
On 4/12/06, Ted Byers <[EMAIL PROTECTED]> wrote: > > > - Original Message - > > From: "Merlin Moncure" <[EMAIL PROTECTED]> > > To: "Janning Vygen" <[EMAIL PROTECTED]> > > Cc: > > Sent: Wednesday, April 12, 2006 12:31 PM > > Subject: Re: [GENERAL] Hardware related question: 3ware 9500S > >

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Geoffrey
Martijn van Oosterhout wrote: On Wed, Apr 12, 2006 at 02:53:01PM -0400, Ted Byers wrote: I take it that "RAID 1+0" refers to a combination of Raid 1 and RAID 0. What about RAID 10? I am curious because RAID 10 has come out since the last time I took a look at RAID technology. I am not sure wh

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Martijn van Oosterhout
On Wed, Apr 12, 2006 at 02:53:01PM -0400, Ted Byers wrote: > I take it that "RAID 1+0" refers to a combination of Raid 1 and RAID 0. > What about RAID 10? I am curious because RAID 10 has come out since the > last time I took a look at RAID technology. I am not sure what it actually > does dif

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Ted Byers
- Original Message - From: "Scott Marlowe" <[EMAIL PROTECTED]> To: "Ted Byers" <[EMAIL PROTECTED]> Cc: "Merlin Moncure" <[EMAIL PROTECTED]>; "Janning Vygen" <[EMAIL PROTECTED]>; "pgsql general" Sent: Wednesday, April 12, 2006 2:24 PM Subject: Re: [GENERAL] Hardware related question:

Re: [GENERAL] sound index

2006-04-12 Thread Alex Mayrhofer
Teodor Sigaev wrote: >> also, i'd be happy to listen opinions from people who have experience >> of usage of such things like soundex. I'm using metaphone() together with levenshtein() to search a place name gazetteer database and order the results. That works reasonably well and gives interestin

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Scott Marlowe
On Wed, 2006-04-12 at 13:10, Ted Byers wrote: > > - Original Message - > > From: "Merlin Moncure" <[EMAIL PROTECTED]> > > To: "Janning Vygen" <[EMAIL PROTECTED]> > > Cc: > > Sent: Wednesday, April 12, 2006 12:31 PM > > Subject: Re: [GENERAL] Hardware related question: 3ware 9500S > > [sni

Re: [GENERAL] Leverage your PostgreSQL V8.1 skills to learn DB2

2006-04-12 Thread Scott Marlowe
On Wed, 2006-04-12 at 11:28, Ian Harding wrote: > This is interesting. > > http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0603wasserman2/ > > There are a few bugs > > 1. In the graphic overview PostgreSQL == Progres > 2. In description of PostgreSQL database cluster, "After >

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Ted Byers
- Original Message - From: "Merlin Moncure" <[EMAIL PROTECTED]> To: "Janning Vygen" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, April 12, 2006 12:31 PM Subject: Re: [GENERAL] Hardware related question: 3ware 9500S [snip] > - I want to know if 3ware 9500 S is recommended or if its one o

[GENERAL] "Hidden" field for each column

2006-04-12 Thread Don Y
Hi, Is there any way that I can consistently (across all tables) add a parameter defining "what" each column "is"? (sorry, crappy grammar and ill-formed question). I want to be able to embed in the database parameters that tell it how to interpret each column. In other words, while the TYPE fo

[GENERAL] Off-Topic: DBMS Market Research

2006-04-12 Thread Renato Cramer
Hello All, Can someone where I can found DBMS Market Researches? What institutes publish reliable researchs? Gartner, IDC? Thanks in advance. Renato Cramer. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Janning Vygen
Thanks for your fast reply. Am Mittwoch, 12. April 2006 18:31 schrieb Merlin Moncure: > On 4/12/06, Janning Vygen <[EMAIL PROTECTED]> wrote: > > Hi, > > disk 1: OS, tablespace > > disk 2: indices, WAL, Logfiles > > - Does my partitioning make sense? > > with raid 10 all four drives will appear as

[GENERAL] postmaster.pid

2006-04-12 Thread Ian Harding
The docs state that postmaster.pid is "A lock file recording the current postmaster PID and shared memory segment ID (not present after postmaster shutdown" I never looked until now, but I see the number 5432001 where the pid should be, and the real pid is in /tmp/.s.PGSQL.5432.lock, along with th

Re: [GENERAL] sound index

2006-04-12 Thread Teodor Sigaev
Have a look at contrib/pg_trgm Nikolay Samokhvalov wrote: hello. does anybody know any solutions to the problem of searching words/phrases, which are close to each other by sounding? e.g. soundex index or smth. problem I have: tag suggestion mechanism, similar to google suggest, which is inten

Re: [GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Merlin Moncure
On 4/12/06, Janning Vygen <[EMAIL PROTECTED]> wrote: > Hi, > disk 1: OS, tablespace > disk 2: indices, WAL, Logfiles > - Does my partitioning make sense? with raid 10 all four drives will appear as a single physical device shared by all. I'm personally not a big fan of logical partitioning of a s

[GENERAL] Leverage your PostgreSQL V8.1 skills to learn DB2

2006-04-12 Thread Ian Harding
This is interesting. http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0603wasserman2/ There are a few bugs 1. In the graphic overview PostgreSQL == Progres 2. In description of PostgreSQL database cluster, "After initialization, a database cluster contains a database called pos

Re: [GENERAL] How to import a CSV file (originally from Excel)

2006-04-12 Thread Magnus Hagander
> > \copy "Flight Traffic" from yourfile.csv delimiter as ',' > csv quote as > > '"' > > > > (might need some adaption, of course) > > > > > > Loading 45,000 lines is trivial for copy, it shouldn't take > noticable > > time at all. > > along these lines - can I do something similar (CSV

[GENERAL] Hardware related question: 3ware 9500S

2006-04-12 Thread Janning Vygen
Hi, i don't know much about hard disks and raid controllers but often there is some discussion about which raid controller rocks and which sucks. my hosting company offers me a raid 10 with 4 serial-ata disks. They will use a "3ware 4-Port-RAID-Controller 9500S" More than 4 disks are not possi

[GENERAL] Could not send Query(connection dead)

2006-04-12 Thread Andrus
My client application receives this error randomnly a number of times per day when user tries to save document. TCP connection to server seems to be OK since INSERT INTO logfile ... command which logs this error to database works. (I use singe TCP connection to server in applicaton). How to fix

Re: [GENERAL] hard shut down of system

2006-04-12 Thread Tom Lane
"surabhi.ahuja" <[EMAIL PROTECTED]> writes: > if postmaster is running and i do, > kill -9 -1 > i.e. i did abrupt shut down > i am not able to start postmaster What happens exactly when you try --- what error messages does it print? What method are you using to try to start the postmaster (pg_ctl

Re: [GENERAL] How to import a CSV file (originally from Excel) into a Postgresql 8.0.7 database

2006-04-12 Thread Daniel Tourde
Hello, Thank you for all your answers. I did indeed generate a .csv from OpenOffice (Excel could do the job as well) and I imported it into Postgresql using 'copy'. I had to put the .csv files into /tmp to avoid permissions issues but it went fine and fast. To import 45000 lines took about a sec

Re: [GENERAL] [HACKERS] RH9 postgresql 8.0.7 rpm

2006-04-12 Thread Devrim GUNDUZ
Hi, On Wed, 2006-04-12 at 13:07 +0200, Gaetano Mendola wrote: > > I was able to create it with: > > --nodeps --define 'buildrhel3 1' --define 'build9 1' I'll be hppy if you send the RPMs directly to me; so that I can upload them. A tarball would be fine. Regards, -- The PostgreSQL Company -

Re: [GENERAL] RH9 postgresql 8.0.7 rpm

2006-04-12 Thread Devrim GUNDUZ
Hi, On Wed, 2006-04-12 at 12:24 +0200, Gaetano Mendola wrote: > I thought given this link > > http://www.postgresql.org/ftp/binary/v8.0.7/linux/srpms/redhat/redhat-9/ > > is not empty RH9 was still supported. PostgreSQL is built on Red Hat 9; but "we" (RPM packagers) can't provide RPMs now, be

Re: [GENERAL] [HACKERS] RH9 postgresql 8.0.7 rpm

2006-04-12 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Devrim GUNDUZ wrote: > Hi Gaetano, > > On Tue, 2006-04-11 at 18:31 +0200, Gaetano Mendola wrote: >> I'm trying to build the rpms for RH9, >> I downloaded the srpm for RH9 but I'm stuck on these errors: >> >> Attempt a: >> >> # rpmbuild --rebuild postg

Re: [GENERAL] RH9 postgresql 8.0.7 rpm

2006-04-12 Thread Gaetano Mendola
Joshua D. Drake wrote: > Gaetano Mendola wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Hi all, >> I'm trying to build the rpms for RH9, >> I downloaded the srpm for RH9 but I'm stuck on these errors: > > RH9 is not a supported platform by RedHat or PGDG. > I thought given this