Re: [GENERAL] query performance

2008-04-24 Thread Cox, Brian
> [ scratches head... ] Your example command works as expected for me. > [ rereads thread... ] Oh, you're running 8.1. I think you have to > do the command as a superuser to get that output in 8.1. Later versions > are less picky. Yes, with the right incantations, the FSM information does ap

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-24 Thread Joshua D. Drake
Erik Jones wrote: Next time I'll hold your hand a bit more, but yesterday I was very far out of it (I'm not exactly 100% today either) with a bad head cold. Now, should we have more exchanges to determine who can use the most flowery of speech or should we talk pgsql and schema changes? Perhap

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-24 Thread Erik Jones
On Apr 24, 2008, at 5:43 PM, Scott Marlowe wrote: On Thu, Apr 24, 2008 at 3:43 PM, Rhys Stewart <[EMAIL PROTECTED]> wrote: type). That being said, I would appreciate that any further questions I have not be responded to by single line emails extolling the virtues of properly designed sc

Re: [GENERAL] query performance

2008-04-24 Thread Tom Lane
Brian Cox <[EMAIL PROTECTED]> writes: > I've already posted the tail of this output previously. > I conclude that these lines are not in this file. Where > did they go? [ scratches head... ] Your example command works as expected for me. [ rereads thread... ] Oh, you're running 8.1. I think yo

Re: [GENERAL] Confused by result of pg_catalog.format_type()

2008-04-24 Thread Erik Jones
On Apr 24, 2008, at 5:10 PM, Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: Ah, pg_catalog.format_type(prorettype, null) = '"trigger"', thanks. It's probably fair to ask what it is you want to accomplish here, because comparing format_type's output to a constant seems awfully fragile

Re: [GENERAL] query performance

2008-04-24 Thread Brian Cox
Tom Lane [EMAIL PROTECTED] wrote: At the very end ... you're looking for these messages: ereport(elevel, (errmsg("free space map contains %d pages in %d relations", storedPages, numRels), errdetail("A total of %.0f page slots are in use (including overhe

Re: [GENERAL] query performance

2008-04-24 Thread Tom Lane
Brian Cox <[EMAIL PROTECTED]> writes: > Any hints as to where the FSM info is in this file? At the very end ... you're looking for these messages: ereport(elevel, (errmsg("free space map contains %d pages in %d relations", storedPages, numRels), errdetail("

Re: [GENERAL] query performance

2008-04-24 Thread Brian Cox
Scott Marlowe [EMAIL PROTECTED] wrote: There's bits spread throughout the file, but the summary is at the bottom. Here's a tail of the 'vacuum verbose' output: INFO: vacuuming "pg_toast.pg_toast_797619965" INFO: index "pg_toast_797619965_index" now contains 0 row versions in 1 pages DETAIL

Re: [GENERAL] query performance

2008-04-24 Thread Scott Marlowe
On Thu, Apr 24, 2008 at 6:23 PM, Brian Cox <[EMAIL PROTECTED]> wrote: > Tom Lane [EMAIL PROTECTED] wrote: > > > You need a database-wide vacuum verbose (not just 1 table) to get that > > output ... > > > > I ran: > > > pgsql -U admin -d cemdb -c 'vacuum verbose' > /tmp/pgvac.log 2>&1 > > the out

Re: [GENERAL] query performance

2008-04-24 Thread Brian Cox
Tom Lane [EMAIL PROTECTED] wrote: You need a database-wide vacuum verbose (not just 1 table) to get that output ... I ran: > pgsql -U admin -d cemdb -c 'vacuum verbose' > /tmp/pgvac.log 2>&1 the output file has 2593 lines and, while I haven't looked at all of them, a: > fgrep -i fsm /tmp/p

Re: [GENERAL] query performance

2008-04-24 Thread Tom Lane
Brian Cox <[EMAIL PROTECTED]> writes: > I read in another thread that vacuum verbose would tell me how much FSM > is needed, but I ran it and didn't see any output about this. You need a database-wide vacuum verbose (not just 1 table) to get that output ... regards, tom l

Re: [GENERAL] query performance

2008-04-24 Thread Brian Cox
Tom Lane [EMAIL PROTECTED] wrote: I suspect that your FSM settings are too low, causing free space found by VACUUM to be forgotten about. I read in another thread that vacuum verbose would tell me how much FSM is needed, but I ran it and didn't see any output about this. What is the way to de

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-24 Thread Scott Marlowe
On Thu, Apr 24, 2008 at 3:43 PM, Rhys Stewart <[EMAIL PROTECTED]> wrote: > type). That being said, I would appreciate that any further questions I have > not be responded to by single line emails extolling the virtues of properly > designed schemata, normalization or the like. Well, I would appre

Re: [GENERAL] Confused by result of pg_catalog.format_type()

2008-04-24 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes: > Ah, pg_catalog.format_type(prorettype, null) = '"trigger"', thanks. It's probably fair to ask what it is you want to accomplish here, because comparing format_type's output to a constant seems awfully fragile. Aside from the quotes (which I believe 8.3 won

Re: [GENERAL] Confused by result of pg_catalog.format_type()

2008-04-24 Thread Erik Jones
On Apr 24, 2008, at 4:58 PM, Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: What am I missing? The double quotes in the function result ... Ah, pg_catalog.format_type(prorettype, null) = '"trigger"', thanks. Erik Jones DBA | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 61

Re: [GENERAL] Confused by result of pg_catalog.format_type()

2008-04-24 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes: > What am I missing? The double quotes in the function result ... regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

[GENERAL] Confused by result of pg_catalog.format_type()

2008-04-24 Thread Erik Jones
Here's an example: pagila=# select pg_catalog.format_type(prorettype, NULL) from pg_proc where proname='foo_ins_trig'; format_type - "trigger" (1 row) Time: 3.212 ms pagila=# SELECT 1 FROM pg_proc p WHERE p.proname='foo_ins_trig'

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-24 Thread Rhys Stewart
While I thank you for your time in reading and responding, This world is not ideal at any level, be it the lack of financial equity, the petty prejudices that permeate societies on a whole, increasing gas and food prices worldwide (I've officially parked my car and am taking the bus until gas goes

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Andreas 'ads' Scherbaum
On Thu, 24 Apr 2008 14:02:07 -0400 Merlin Moncure wrote: > On Thu, Apr 24, 2008 at 12:22 PM, Andrew Sullivan <[EMAIL PROTECTED]> wrote: > > The first time I encountered them, I thought enums were a filthy, > > ill-conceived answer to a problem that didn't exist, implemented by people > > who di

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Yep, updated: > > * Allow adding/removing enumerated values to an existing enumerated > > data > > Renaming an existing value might be interesting too (and would be far > easier than either of the above). TODO updated: * A

Re: [GENERAL] Rapidly decaying performance repopulating a large table

2008-04-24 Thread David Wilson
Thanks for the help from everyone on this. Further investigation with the suggested statistics and correlating that with some IO graphs pretty much nailed the problem down to checkpoint IO holding things up, and tuning the checkpoint segments and completion target (128 and 0.9 seemed to be the best

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Yep, updated: > * Allow adding/removing enumerated values to an existing enumerated > data Renaming an existing value might be interesting too (and would be far easier than either of the above). regards, tom lane -

[GENERAL] Problems with postgresql 8.3 installation

2008-04-24 Thread x asasaxax
Hi, I´m using windows vista 64 bits. And i tried to install the postgresql 8.3, but it show this error: "cannot run initdb 1!". I don´t know whats going on... help-me please Thanks

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Bruce Momjian
Matthew T. O'Connor wrote: > Bruce Momjian wrote: > > Matthew T. O'Connor wrote: > >> D. Dante Lorenso wrote: > >>> Or, here's another way to look at it ... make it easier to modify ENUM > >>> datatypes because we all know that you will eventually need that > >>> feature whether you males, female

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread D. Dante Lorenso
Alvaro Herrera wrote: D. Dante Lorenso wrote: Or, here's another way to look at it ... make it easier to modify ENUM datatypes because we all know that you will eventually need that feature whether you males, females, and unknowns think so or not. Agreed. Let's keep in mind that the current

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Matthew T. O'Connor
Bruce Momjian wrote: Matthew T. O'Connor wrote: D. Dante Lorenso wrote: Or, here's another way to look at it ... make it easier to modify ENUM datatypes because we all know that you will eventually need that feature whether you males, females, and unknowns think so or not. +1 Added to TODO

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Chris Browne
[EMAIL PROTECTED] (Andrew Sullivan) writes: > On Wed, Apr 23, 2008 at 07:46:07PM -0400, brian wrote: >> >> Absolutely true. Which is odd, because this example is trotted out >> whenever there's a thread about ENUMs. > > I don't think it's odd at all. In my view, the people who think enums are a

Re: [GENERAL] Adding notes against fields

2008-04-24 Thread Chris Browne
[EMAIL PROTECTED] (Oliver Helm) writes: > Hello, > > > > I was wondering if if is possible to add a note against a field on a > postgresql table?   > > > > For example when running "\d tablename" i would like to have and additional > column called 'notes' which i could add to by altering the tab

[GENERAL] Multiple Database Strategy

2008-04-24 Thread Howard Cole
I run several databases on a windows server all using the same cluster. Each database is backed up separately using pg_dump - but the size of the databases is leading me to think that the WAL backup strategy will reduce my backup bandwidth. The flaw in this is that the WAL backup is not confine

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Tino Wildenhain
Merlin Moncure wrote: On Thu, Apr 24, 2008 at 12:22 PM, Andrew Sullivan <[EMAIL PROTECTED]> wrote: The first time I encountered them, I thought enums were a filthy, ill-conceived answer to a problem that didn't exist, implemented by people who didn't understand relational databases. With con

Re: [GENERAL] I think this is a BUG?

2008-04-24 Thread Alban Hertroys
On Apr 24, 2008, at 10:11 AM, Kaloyan Iliev wrote: regbgrgr=# ALTER TABLE test ADD COLUMN not_null INT NOT NULL ; ERROR: column "id" contains null values ==EXAMPLE2 == Example2: In this case the postgress fill the NOT

Re: [GENERAL] Adding notes against fields

2008-04-24 Thread Alvaro Herrera
Joshua D. Drake wrote: > On Thu, 24 Apr 2008 19:04:34 +0100 > Richard Huxton <[EMAIL PROTECTED]> wrote: > > > Oliver Helm wrote: > > > Hello, > > > > > > I was wondering if if is possible to add a note against a field on > > > a postgresql table? > > > > You can add comments: COMMENT ON IS 'tex

Re: [GENERAL] Adding notes against fields

2008-04-24 Thread Joshua D. Drake
On Thu, 24 Apr 2008 19:04:34 +0100 Richard Huxton <[EMAIL PROTECTED]> wrote: > Oliver Helm wrote: > > Hello, > > > > I was wondering if if is possible to add a note against a field on > > a postgresql table? > > You can add comments: COMMENT ON IS 'text' - see > manuals for details. > Howeve

Re: [GENERAL] Adding notes against fields

2008-04-24 Thread Richard Huxton
Oliver Helm wrote: Hello, I was wondering if if is possible to add a note against a field on a postgresql table? You can add comments: COMMENT ON IS 'text' - see manuals for details. -- Richard Huxton Archonet Ltd -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Merlin Moncure
On Thu, Apr 24, 2008 at 12:22 PM, Andrew Sullivan <[EMAIL PROTECTED]> wrote: > The first time I encountered them, I thought enums were a filthy, > ill-conceived answer to a problem that didn't exist, implemented by people > who didn't understand relational databases. With considerably more > e

[GENERAL] Adding notes against fields

2008-04-24 Thread Oliver Helm
Hello, I was wondering if if is possible to add a note against a field on a postgresql table? For example when running "\d tablename" i would like to have and additional column called 'notes' which i could add to by altering the table. As the note would be field specific, not row specifi

Re: [GENERAL] Which Python library - psycopg2 or pygresql?

2008-04-24 Thread Harald Armin Massa
Micah, psycopg2 has a license extensions which allows basically to use psycopg2 binaries without distributing source code as long as there are no modifications to the psycopg2 C code best wishes Harald -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Straße 49 70

Re: [GENERAL] Stored procedures in C

2008-04-24 Thread Emiliano Moscato
Guys, it has nothing to do with my question :D I don't know why Martin answer to me anything about Cobol. I just was looking how to query database in a stored procedure in C. Some people pointed me to SPI documentation (at chapter 41 of oficial Postgres documentation) that is being useful. Thanks f

Re: [GENERAL] Which Python library - psycopg2 or pygresql?

2008-04-24 Thread Micah Yoder
On Tuesday 15 April 2008 10:27:14 am Dawid Kuroczko wrote: > Whch would you suggest? > How do they differ? Sorry to bring this back up (I try to keep up with this list but it's hard!), but isn't licensing a concern? If I understand correctly, pygresql is BSD-licensed, but depends on MX which is

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Scott Marlowe
On Thu, Apr 24, 2008 at 10:22 AM, Andrew Sullivan <[EMAIL PROTECTED]> wrote: > > Otherwise, don't use enums. They should be marked (like char(), IMO) in the > manual as, "Warning: you probably don't want to use this datatype. Go think > some more." Good point. I think enums are kind like arra

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Andrew Sullivan
On Thu, Apr 24, 2008 at 11:04:10AM -0500, D. Dante Lorenso wrote: > > Or, here's another way to look at it ... make it easier to modify ENUM > datatypes because we all know that you will eventually need that feature > whether you males, females, and unknowns think so or not. Well, heck, why don

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Bruce Momjian
Matthew T. O'Connor wrote: > D. Dante Lorenso wrote: > > Andrew Sullivan wrote: > >> I don't think it's odd at all. In my view, the people who think > >> enums are a > >> good datatype for databases are exactly the sorts who'd think that their > >> data is as static as this poor understanding of

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Alvaro Herrera
D. Dante Lorenso wrote: > Or, here's another way to look at it ... make it easier to modify ENUM > datatypes because we all know that you will eventually need that feature > whether you males, females, and unknowns think so or not. Agreed. Let's keep in mind that the current ENUM implementat

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Matthew T. O'Connor
D. Dante Lorenso wrote: Andrew Sullivan wrote: I don't think it's odd at all. In my view, the people who think enums are a good datatype for databases are exactly the sorts who'd think that their data is as static as this poor understanding of the vagaries of individuals' sex (gender is a dif

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread D. Dante Lorenso
Andrew Sullivan wrote: On Wed, Apr 23, 2008 at 07:46:07PM -0400, brian wrote: Absolutely true. Which is odd, because this example is trotted out whenever there's a thread about ENUMs. I don't think it's odd at all. In my view, the people who think enums are a good datatype for databases are ex

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Scott Marlowe
On Thu, Apr 24, 2008 at 9:39 AM, Andrew Sullivan <[EMAIL PROTECTED]> wrote: > On Wed, Apr 23, 2008 at 07:46:07PM -0400, brian wrote: > > > > Absolutely true. Which is odd, because this example is trotted out > > whenever there's a thread about ENUMs. > > I don't think it's odd at all. In my vi

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Andrew Sullivan
On Wed, Apr 23, 2008 at 07:46:07PM -0400, brian wrote: > > Absolutely true. Which is odd, because this example is trotted out > whenever there's a thread about ENUMs. I don't think it's odd at all. In my view, the people who think enums are a good datatype for databases are exactly the sorts wh

Re: [HACKERS] [GENERAL] I think this is a BUG?

2008-04-24 Thread Brendan Jurd
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Apr 24, 2008 at 7:13 PM, Richard Huxton wrote: > Kaloyan Iliev wrote: > > r=# CREATE TABLE test( a text, b int); > > CREATE TABLE > > r=# INSERT INTO test VALUES ('test',1); > > INSERT 0 1 > > r=# ALTER TABLE test ADD COLUMN id INT NOT NULL P

Re: [GENERAL] WAL shipping with archive_timeout & pg_switch_xlog()

2008-04-24 Thread Tom Lane
wstrzalka <[EMAIL PROTECTED]> writes: > archive_timeout is used for WAL shipping to standby server in my case > (are there any other reasons?), but WAL is switched by the timeout > even if there are no changes on the server. This is intentional. Some people consider the arrival of a new WAL file

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-24 Thread Tom Lane
wstrzalka <[EMAIL PROTECTED]> writes: > So - does it mean that the whole IF-ELSE-ENDIF is not parsed at once - > but lazy-parsed when the control reaches it, while the IF condition is > parsed as a single expression and therefore I get error in this case? Right, for a suitable definition of "parse

Re: [GENERAL] error connecting to database: could not open relation

2008-04-24 Thread Scott Marlowe
On Wed, Apr 23, 2008 at 10:44 PM, "PontoSI - Consultoria, Informática e Serviços LDA" <[EMAIL PROTECTED]> wrote: > > Hi, > I've had a server crash on a machine running FreeBSD 6 and PG 8.2.5. The > database was running at the time of the crash, and probably there was some > lost data. When I try

Re: [GENERAL] error connecting to database: could not open relation

2008-04-24 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > Ok, 2661 is definitly pg_cast_source_target_index on my system so the > -P should have caused postgres to ignore it. That was my first thought too. However, if the pg_internal.init file were missing/broken then the thing would try to rebuild it

Re: [GENERAL] Stored procedures in C

2008-04-24 Thread Merlin Moncure
On Wed, Apr 23, 2008 at 6:38 PM, Martin Gainty <[EMAIL PROTECTED]> wrote: > > > Emiliano and Mike > > The real challenge is trying to determine what a datatype is in cobol..for > that matter what is stack variable or heap in Cobol? > In the end you're better off writing this mess (preferably in Jav

Re: [GENERAL] Best backup setup

2008-04-24 Thread Erik Jones
On Apr 23, 2008, at 10:03 AM, Gabor Siklos wrote: I need to back up our database off-site for disaster recovery. If I just back up the entire database data directory (i.e. /var/lib/pgsql/ data) will I be able to restore from there? Or should I instead just dump the data, using pg_dump, and

Re: [GENERAL] initdb in 8.3

2008-04-24 Thread Tom Lane
"Christopher Condit" <[EMAIL PROTECTED]> writes: > Although, once you've built the index with varchar_pattern_ops index, > the following two (essentially equivalent) queries will run at vastly > different speeds: > select * from A where A.value like 'Nacho'; > select * from A where A.value = 'Nacho

Re: [GENERAL] initdb in 8.3

2008-04-24 Thread Christopher Condit
Ahhh - I See. Thanks, Craig. Although, once you've built the index with varchar_pattern_ops index, the following two (essentially equivalent) queries will run at vastly different speeds: select * from A where A.value like 'Nacho'; select * from A where A.value = 'Nacho'; Seems that the optimizer s

Re: [GENERAL] Stored procedures in C

2008-04-24 Thread Martin Gainty
Good Morning Emiliano- since postgres is written in 'C' and Most of us on this list have programmed in C ..although my experience was 'used in last millenia' if we reference contrib/query/tsearch2/query.c when you see statements such as PG_FUNCTION_INFO_V1(tsquery_in); you are calling a heade

Re: [GENERAL] Stored procedures in C

2008-04-24 Thread Emiliano Moscato
Thanks a lot for the response Andrej! One of these texts was known for me. But all of them are VERY basic. No one explains how to do a query and manage results :( The only one that manage querys is the source code placed at contrib/tablefunc in the Postgres distribution. But is VERY hard to follow

[GENERAL] PAM + Password authentication

2008-04-24 Thread Bohdan Linda
Hello, Can the PGSQL database be configured that it performs authentication against PAM and if fails the it tries against internal mechanizm? I would like to migrate to PAM, but I do not want to promote some users to system wide. Till now I am able to do one or the other way. Thank you, Bohdan

Re: [GENERAL] I think this is a BUG?

2008-04-24 Thread Richard Huxton
Kaloyan Iliev wrote: Hi, I find something very interesting which I think is a bug and I want to discuss it. --- Here is the example1: 1.I create a table without PK; 2.Insert 1 row; 3.I ADD PK; 4.When I select all ID's are

[GENERAL] I think this is a BUG?

2008-04-24 Thread Kaloyan Iliev
Hi, I find something very interesting which I think is a bug and I want to discuss it. --- Here is the example1: 1.I create a table without PK; 2.Insert 1 row; 3.I ADD PK; 4.When I select all ID's are with NULL values, but

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Andreas 'ads' Scherbaum
On Wed, 23 Apr 2008 17:18:12 -0600 Scott Marlowe wrote: > I would put it that gender is not so easily defined, which makes it a > poor choice for enum. That's why my original statement had the additional note about special cases. If you write an address book you normally don't want to add inform

Re: [GENERAL] Backup setup

2008-04-24 Thread Tomasz Ostrowski
On 2008-04-23 17:22, Terry Lee Tucker wrote: > On Wednesday 23 April 2008 11:14, Gabor Siklos wrote: >> The advantage of the first method would be that I would not have to wait >> for pg_dump (it takes quite long on our 60G+ database) and would just be >> able to configure the backup agent to monit

Re: [GENERAL] error connecting to database: could not open relation

2008-04-24 Thread Martijn van Oosterhout
On Thu, Apr 24, 2008 at 08:17:15AM +0100, "PontoSI - Consultoria, Informática e Serviços LDA" wrote: > > %/usr/local/bin/postgres --single -P -D /usr/local/pgsql/data/ > FATAL: XX000: could not open relation with OID 2661 > LOCATION: relation_open, heapam.c:700 > % > > is the name of the dat