Re: [GENERAL] add column specify position

2010-02-02 Thread Shoaib Mir
On Wed, Feb 3, 2010 at 4:14 PM, Scott Frankel wrote: > > Hi all, > > Is it possible to specify a position when adding a column to a table? > > Not possible, but have a read of http://wiki.postgresql.org/wiki/Alter_column_position and look at the alternative options. -- Shoaib Mir http://shoaibm

[GENERAL] surprised by non-strict array_append

2010-02-02 Thread J. Greg Davidson
I was caught out today by the non-strict behavior of array_append causing me to get an undesired result for a COALESCE. My subsequent attempt to create a STRICT VARIADIC generalization of array_append led to another surprise. The problem was easily solved, but might be of interest to others. Per

[GENERAL] stat collector is not using

2010-02-02 Thread AI Rumman
I am using Postgresql 8.1. I set stats_start_collector = on But I found statistics collector is not using; show stats_start_collector; stats_start_collector --- on (1 row) select * from pg_stat_user_indexes where idx_scan > 0; relid | indexrelid | schemaname | relname | i

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread dipti shah
That makes sense. Thanks, Dipti On Wed, Feb 3, 2010 at 12:08 PM, John R Pierce wrote: > dipti shah wrote: > >> I am connected to database as postgres user. >> '\!exec ..' doesn't work if I connect to the database from other host but >> it does work if I connect to the database from server wher

Re: [GENERAL] Does PostGreSQL support SSL inbuilt?

2010-02-02 Thread dipti shah
Thanks a lot Robert and Howard. I got the information about how to set server configuration to make SSL aware only. Please see below and let me know if I am missing anything. 1. I need to switch on "ssl" attribute in postgresql.conf and compile the server again. 2. In pg_hba.conf, I have to

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread John R Pierce
dipti shah wrote: I am connected to database as postgres user. '\!exec ..' doesn't work if I connect to the database from other host but it does work if I connect to the database from server where I have PostGreSQL installed. pg_read_file doesn't work in any case. Techdb=# \! exec cat /etc/

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread dipti shah
I am connected to database as postgres user. '\!exec ..' doesn't work if I connect to the database from other host but it does work if I connect to the database from server where I have PostGreSQL installed. pg_read_file doesn't work in any case. Techdb=# \! exec cat /etc/postgresql/8.4/main/pg_h

Re: [GENERAL] add column specify position

2010-02-02 Thread Johan Nel
Hi Scott Scott Frankel wrote: Hi all, Is it possible to specify a position when adding a column to a table? No not AFAIK. I want to swap one column for another without losing the column's position. eg: given that 'foo' is the 5th column in an 8 column table, I want to replace it with a 'b

[GENERAL] add column specify position

2010-02-02 Thread Scott Frankel
Hi all, Is it possible to specify a position when adding a column to a table? I want to swap one column for another without losing the column's position. eg: given that 'foo' is the 5th column in an 8 column table, I want to replace it with a 'bar' column at column 5. ALTER TABL

[GENERAL] Need Advice In Improving Database Disc Usage

2010-02-02 Thread Yan Cheng Cheok
Hello, We are now planning to move over, from plan text file storage to database storage. However, we do see our disc usage increased by factor of 50. http://sites.google.com/site/yanchengcheok/Home/du.PNG (1) Is there any need for me to create idx_fk_measurement_type_id and idx_fk_measurement

Re: [GENERAL] What is the graceful way to stop (kill) postmaster?

2010-02-02 Thread Adrian Klaver
On Tuesday 02 February 2010 5:39:32 pm Wang, Mary Y wrote: > Hi, > > What is the graceful way to stop(kill) postmaster? I didn't use pg_ctl to > start so I won't use pg_ctl stop the postmaster. I used > '/usr/bin/postmaster -D /var/lib/pgsql/data -i&'. I was told not to use > 'kill -9'. > > Ma

Re: [GENERAL] PostgreSQL licence

2010-02-02 Thread Lew
Thom Brown wrote: I guess it's not a major point considering BSD and MIT are so similar, but people may become confused when Wikipedia says one thing, and the official site says another. That's on them. Wikipedia is not, in general, to be taken as an authoritative source but as an indicative

[GENERAL] Is it necessary to have index for child table in following case?

2010-02-02 Thread Yan Cheng Cheok
Due to the fact "A serious limitation of the inheritance feature is that indexes (including unique constraints) and foreign key constraints only apply to single tables, not to their inheritance children. This is true on both the referencing and referenced sides of a foreign key constraint. Thus

[GENERAL] What is the graceful way to stop (kill) postmaster?

2010-02-02 Thread Wang, Mary Y
Hi, What is the graceful way to stop(kill) postmaster? I didn't use pg_ctl to start so I won't use pg_ctl stop the postmaster. I used '/usr/bin/postmaster -D /var/lib/pgsql/data -i&'. I was told not to use 'kill -9'. Mary Mary Y Wang -

Re: [GENERAL] Problem with partition tables and schemas

2010-02-02 Thread Schwaighofer Clemens
I tried that too, in all of my trigger functions, it still didn't change anything. On Wed, Feb 3, 2010 at 09:42, Tom Lane wrote: > Clemens Schwaighofer writes: >> I already tried that. even with prefixing the alter table statement >> with the schema it does not work. > > Not the ALTER TABLE, the

Re: [GENERAL] Problem with partition tables and schemas

2010-02-02 Thread Tom Lane
Clemens Schwaighofer writes: > I already tried that. even with prefixing the alter table statement > with the schema it does not work. Not the ALTER TABLE, the insert/update/etc commands inside the trigger functions. regards, tom lane -- Sent via pgsql-general mailing l

Re: [GENERAL] pg_dump issues

2010-02-02 Thread Reece Hart
On 02/02/2010 03:41 PM, DM wrote: You were right, after zipping the dump file it came out to 6.9G Also check out the "custom" pg_dump format (pg_dump -Fc ...), which is compressed. There are caveats regarding portability across PG versions with the custom format, which you may want to resear

[GENERAL] JOIN Record returning Function

2010-02-02 Thread Daniel Schuchardt
Hy Group, i have a function that returns a record. myfunc(IN id INTEGER) RETURNS RECORD. in that function the record is build from some subquery's in dependence of data. Now i need to join that function to its correponding main table that holds the id. SELECT myfunc.* FROM maintable JOIN

Re: [GENERAL] Problem with partition tables and schemas

2010-02-02 Thread Clemens Schwaighofer
I already tried that. even with prefixing the alter table statement with the schema it does not work. I suspect that has something to do that when I try to connect eg visit_201002 with the session table, that there is not data in the session table itself, but in its subtable, I can connect visit_2

Re: [GENERAL] Attribute a value to a record

2010-02-02 Thread Florent THOMAS
Hy I made an additionnal test FOR ventilation_local IN (SELECT * FROM XXX) LOOP IF (mytest) THEN RAISE NOTICE 'ventilation %', ventilation_local; ventilation_local.myfield:=10; RAISE NOTICE 'ventilation %', ventilation_local; END IF; END LOOP; the

Re: [GENERAL] pg_dump issues

2010-02-02 Thread DM
You were right, after zipping the dump file it came out to 6.9G Thanks for your help. thanks Deepak On Tue, Feb 2, 2010 at 3:20 PM, Scott Marlowe wrote: > On Tue, Feb 2, 2010 at 4:07 PM, DM wrote: > > Hi All, > > I have a database with only one schema with 5 tables > > nspname | relname

[GENERAL] Attribute a value to a record

2010-02-02 Thread Florent THOMAS
Hello, I'm currently running on pg8.4 and I have a trigger with a loop : FOR ventilation_local IN (SELECT * FROM XXX) LOOP IF (mytest) THEN ventilation_local.myfield:=mynewvalue; END IF; END LOOP; my problem is that the record doen't accept the new value. I've chek before the val

Re: [GENERAL] pg_dump issues

2010-02-02 Thread Jean-Yves F. Barbier
DM a écrit : > Hi All, > > I have a database with only one schema with 5 tables > > nspname | relname | size > -+-+- > sch | job1 | 211 MB > sch | job2 | 5611 MB > sch |

Re: [GENERAL] pg_dump issues

2010-02-02 Thread Scott Marlowe
On Tue, Feb 2, 2010 at 4:07 PM, DM wrote: > Hi All, > I have a database with only one schema with 5 tables > nspname |       relname           |  size >      -+-+- >      sch     | job1                      | 211 MB >      sch     | job2                      | 5

Re: [GENERAL] pg_dump issues

2010-02-02 Thread DM
Hi All, I have a database with only one schema with 5 tables nspname | relname | size -+-+- sch | job1 | 211 MB sch | job2 | 5611 MB sch | job3 | 658

[GENERAL] pg_dump issues

2010-02-02 Thread DM
Hi All, I have a database with only one schema with 5 tables nspname | relname | size -+-+- sch | job1 | 211 MB sch | job2 | 5611 MB sch | job3 | 658

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread Alvaro Herrera
Joshua D. Drake escribió: > On Tue, 2010-02-02 at 16:09 -0300, Alvaro Herrera wrote: > > Tim Bruce - Postgres escribió: > > > On Tue, February 2, 2010 08:23, Alvaro Herrera wrote: > > > > > > Probably pg_read_file(): > > > > > > > > select pg_read_file('pg_hba.conf', 0, 8192); > > > > > > > > Note

Re: [GENERAL] Unusual table size and very slow inserts

2010-02-02 Thread Scott Marlowe
On Tue, Feb 2, 2010 at 1:45 PM, Ivano Luberti wrote: > In this table and all her sisters in the other schemas, records are only > inserted and deleted. No update same diff. In pgsql an update equals a delete and an insert. deleted rows use up space just like former versions from an update. If

Re: [GENERAL] Unusual table size and very slow inserts

2010-02-02 Thread Ivano Luberti
Ok I definitely food for thought and that is what I was searching for, as stated in my first message. Thanks to Richard and Bill for that. But I have a few things that still I don't understand and I think I had not outlined enough. > > >> What really worries and puzzles me is the size of the ta

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread Joshua D. Drake
On Tue, 2010-02-02 at 16:09 -0300, Alvaro Herrera wrote: > Tim Bruce - Postgres escribió: > > On Tue, February 2, 2010 08:23, Alvaro Herrera wrote: > > > > Probably pg_read_file(): > > > > > > select pg_read_file('pg_hba.conf', 0, 8192); > > > > > > Note that pg_read_file only allows paths relativ

Re: [GENERAL] Startup proc 30595 exited with status 512 - abort and FATAL 2: XLogFlush

2010-02-02 Thread Wang, Mary Y
More information, I'd like to use pg_dump or pg_dumpall to dump my data. How would I do that if I can't even start the postmaster? I saw someone mentioned about using pg_resetxlog $PGDATA so that he would do a pg_dump. Is that the only option that I have? If so, what are some of the cautions

Re: [GENERAL] Unusual table size and very slow inserts

2010-02-02 Thread Bill Moran
In response to Ivano Luberti : > > > >> In only one case so far, the "code" table with 442 record has a size of > >> 18MB. If I run an vacuum full and a reindex it shrinks to less than > >> 100KB. > >> If I use the software to delete the rows and reinsert the same records > >> it explodes again to

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread Alvaro Herrera
Tim Bruce - Postgres escribió: > On Tue, February 2, 2010 08:23, Alvaro Herrera wrote: > > Probably pg_read_file(): > > > > select pg_read_file('pg_hba.conf', 0, 8192); > > > > Note that pg_read_file only allows paths relative to $PGDATA, which is > > what you get from SHOW data_directory; > > Si

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread Tim Bruce - Postgres
On Tue, February 2, 2010 08:23, Alvaro Herrera wrote: > dipti shah escribió: >> Techdb=# show hba_file; >>hba_file >> -- >> /etc/postgresql/8.4/main/pg_hba.conf >> (1 row) >> >> Moreover, is there anyway to view content of this file from stored i

Re: [GENERAL] Unusual table size and very slow inserts

2010-02-02 Thread Ivano Luberti
Richard Huxton ha scritto: > On 02/02/10 14:46, Ivano Luberti wrote: >> Sorry to post this again, but I have seen no response at all and this is >> strange on this list. >> Maybe I have not properly submitted my question ? > > You've replied to an existing question, which means your message is >

[GENERAL] Startup proc 30595 exited with status 512 - abort and FATAL 2: XLogFlush

2010-02-02 Thread Wang, Mary Y
Hi, Sorry for the double posting. I'm having a bad day. My Postgresql has this error "FATAL 2: XLogFlush: request is not satisfied". I tried to follow the instructions from a thread about looking for a core dump, but when I tried to start the postmaster, I got "/usr/bin/postmaster: Startup p

Re: [GENERAL] Connect RDF to PostgreSQL?

2010-02-02 Thread Joshua D. Drake
On Tue, 2010-02-02 at 08:51 -0500, Aaron wrote: > I am presenting on PostgreSQL tonight and someone e-mailed me with a > question before my talk so I might be able to find him an answer: > > "We are starting a new, large project that uses an ontology based ( > RDF - Resource Description Framework

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread Alvaro Herrera
dipti shah escribió: > Techdb=# show hba_file; >hba_file > -- > /etc/postgresql/8.4/main/pg_hba.conf > (1 row) > > Moreover, is there anyway to view content of this file from stored in above > location "Techdb" command prompt itself. > > Techdb

Re: [GENERAL] ERROR: relation xxx is still open (Re: Use Trigger to Remove Table ... )

2010-02-02 Thread Tom Lane
Josh Kupershmidt writes: > For the record, I think having a trigger drop a table automatically when > it's empty is probably a bad idea. But I tried it out anyways, and got a > surprising: > ERROR: relation 16400 is still open > when the trigger function attempted to drop the table. > Can anyone

Re: [GENERAL] Problem with partition tables and schemas

2010-02-02 Thread Tom Lane
Clemens Schwaighofer writes: > my problem is, when I insert data into the visit table it tries to > find the session data in the live schema. I have no idea why, because > no schema was copied or inherited from the other side. I think you need to schema-qualify the table names used in the trigger

[GENERAL] ERROR: relation xxx is still open (Re: Use Trigger to Remove Table ... )

2010-02-02 Thread Josh Kupershmidt
On Mon, Feb 1, 2010 at 10:38 PM, Yan Cheng Cheok wrote: > May I know how I can use trigger technique, to remove the table itself, > when after delete operation, there is 0 row in the table? > > For the record, I think having a trigger drop a table automatically when it's empty is probably a bad i

Re: [GENERAL] PostgreSQL licence

2010-02-02 Thread Tom Lane
Devrim =?ISO-8859-1?Q?G=DCND=DCZ?= writes: > On Tue, 2010-02-02 at 13:09 +, Thom Brown wrote: >> Could someone clarify, is this guy indeed correct and the licence page >> needs updating stating it's something similar to an MIT licence, or is >> he just plain wrong? As it stands, the Wikipedia

Re: [GENERAL] Can LISTEN/NOTIFY deal with more than 100 every second?

2010-02-02 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 >>> CREATE OR REPLACE RULE send_notify AS ON INSERT TO log DO >>> ALSO NOTIFY logevent; >

Re: [GENERAL] Unusual table size and very slow inserts

2010-02-02 Thread Richard Huxton
On 02/02/10 14:46, Ivano Luberti wrote: Sorry to post this again, but I have seen no response at all and this is strange on this list. Maybe I have not properly submitted my question ? You've replied to an existing question, which means your message is hidden in amidst the replies to that.

[GENERAL] Unusual table size and very slow inserts

2010-02-02 Thread Ivano Luberti
Sorry to post this again, but I have seen no response at all and this is strange on this list. Maybe I have not properly submitted my question ? I wish also to add another parameter: the size problem is usually associated with the following log messages: 2010-02-02 00:00:14 GMTLOG: checkpoints a

Re: [GENERAL] PostgreSQL licence

2010-02-02 Thread Karsten Hilbert
On Tue, Feb 02, 2010 at 02:30:47PM +, Thom Brown wrote: > I guess it's not a major point considering BSD and MIT are so similar, but > people may become confused when Wikipedia says one thing, and the official > site says another. Then it seems prudent to add clarification (as to the ambiguit

Re: [GENERAL] PostgreSQL licence

2010-02-02 Thread Thom Brown
2010/2/2 Vincenzo Romano > 2010/2/2 Thom Brown : > > 2010/2/2 Devrim GÜNDÜZ > >> > >> On Tue, 2010-02-02 at 13:09 +, Thom Brown wrote: > >> > > >> > Could someone clarify, is this guy indeed correct and the licence page > >> > needs updating stating it's something similar to an MIT licence,

Re: [GENERAL] PostgreSQL licence

2010-02-02 Thread Vincenzo Romano
2010/2/2 Thom Brown : > 2010/2/2 Devrim GÜNDÜZ >> >> On Tue, 2010-02-02 at 13:09 +, Thom Brown wrote: >> > >> > Could someone clarify, is this guy indeed correct and the licence page >> > needs updating stating it's something similar to an MIT licence, or is >> > he just plain wrong?  As it st

Re: [GENERAL] PostgreSQL licence

2010-02-02 Thread Thom Brown
2010/2/2 Devrim GÜNDÜZ > On Tue, 2010-02-02 at 13:09 +, Thom Brown wrote: > > > > Could someone clarify, is this guy indeed correct and the licence page > > needs updating stating it's something similar to an MIT licence, or is > > he just plain wrong? As it stands, the Wikipedia page on Pos

[GENERAL] Problem with partition tables and schemas

2010-02-02 Thread Clemens Schwaighofer
Hi, I have a problem with partition tables and schemas Postgres: 8.4.2 on redhat and debian I have three schemas public (the default one), live and test live and test are identical copies in table layout, just the tables are created for each one sperated. in those two schemas I have two tables

[GENERAL] Connect RDF to PostgreSQL?

2010-02-02 Thread Aaron
I am presenting on PostgreSQL tonight and someone e-mailed me with a question before my talk so I might be able to find him an answer: "We are starting a new, large project that uses an ontology based ( RDF - Resource Description Framework http://en.wikipedia.org/wiki/Resource_Description_Framewor

Re: [GENERAL] PostgreSQL licence

2010-02-02 Thread Devrim GÜNDÜZ
On Tue, 2010-02-02 at 13:09 +, Thom Brown wrote: > > Could someone clarify, is this guy indeed correct and the licence page > needs updating stating it's something similar to an MIT licence, or is > he just plain wrong? As it stands, the Wikipedia page on PostgreSQL > says "similar to the MIT

Re: [GENERAL] Is this the warning message I should pay attention on it, during table partition

2010-02-02 Thread Alban Hertroys
On 2 Feb 2010, at 4:40, Yan Cheng Cheok wrote: > NOTICE: merging column "unit_id" with inherited definition > > Is this the warning message I should take any action on it? If not, how I can > suppress it? It is quite annoying, when I saw these message keep printing out > from my c++ console.

[GENERAL] PostgreSQL licence

2010-02-02 Thread Thom Brown
Please have a look at http://en.wikipedia.org/wiki/Talk:PostgreSQL#License.3F This guy is insisting that PostgreSQL is NOT released under the BSD licence, a directly contradiction of the PostgreSQL page on licensing: http://www.postgresql.org/about/licence (At this point, I've noticed that the UR

Re: [GENERAL] Can LISTEN/NOTIFY deal with more than 100 every second?

2010-02-02 Thread Gavin Mu
Hi, Greg, Thanks for your reply, and I described my case more clearly inline. Regards, Gavin Mu 2010/2/1 Greg Sabino Mullane : > > -BEGIN PGP SIGNED MESSAGE- > Hash: RIPEMD160 > > >> I am prototyping a system which sends all INSERT/UPDATE/DELETE events >> to a third party software, I do:

Re: [GENERAL] Does PostGreSQL support SSL inbuilt?

2010-02-02 Thread Howard Cole
dipti shah wrote: Hi, I am new to PostGreSQL authentication mechanism. Does PostGreSQL support SSL? How could I make sure that psql client communicates with PostGreSQL server securely? Thanks, Dipti Yes. See http://www.postgresql.org/docs/8.4/static/ssl-tcp.html. You can force the server

[GENERAL] Partitioning: indexes, tables and FKs

2010-02-02 Thread Vincenzo Romano
Hi all. I'd like to understand how partitioning (actually table inheritance) works when the number of tables grows in the order of thousands. In my case, all child tables inherit also the indexes from the master one (as well as constraints). 1. How will change the performances in the case a relev

Re: [GENERAL] Can LISTEN/NOTIFY deal with more than 100 every second?

2010-02-02 Thread Gavin Mu
with your reminder I had a look at the code of the LISTEN/NOTIFY implementation, NOTIFY will send SIGUSR2 signal to the backend if it's not for itself. I guess frequent singal handling can't be handled on time. 2010/2/1 Yeb Havinga : > Gavin Mu wrote: >> >> CREATE OR REPLACE RULE send_notify AS O

[GENERAL] Does PostGreSQL support SSL inbuilt?

2010-02-02 Thread dipti shah
Hi, I am new to PostGreSQL authentication mechanism. Does PostGreSQL support SSL? How could I make sure that psql client communicates with PostGreSQL server securely? Thanks, Dipti

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread dipti shah
Wow!!..that was too quick. Thanks Richard. On Tue, Feb 2, 2010 at 3:29 PM, Richard Huxton wrote: > On 02/02/10 09:55, dipti shah wrote: > >> Thanks Richard and Alvaro. The "show hba_file" is great solution. Thanks a >> ton. Could you tell me from where to get all such commands? >> > > All the co

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread Richard Huxton
On 02/02/10 09:58, dipti shah wrote: Techdb=# show hba_file; hba_file -- /etc/postgresql/8.4/main/pg_hba.conf (1 row) Ah! you're running a Debian-based system by the look of it. Moreover, is there anyway to view content of this file from s

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread Richard Huxton
On 02/02/10 09:55, dipti shah wrote: Thanks Richard and Alvaro. The "show hba_file" is great solution. Thanks a ton. Could you tell me from where to get all such commands? All the configuration settings are listed in Chapter 18: http://www.postgresql.org/docs/8.4/static/runtime-config.html You

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread dipti shah
Techdb=# show hba_file; hba_file -- /etc/postgresql/8.4/main/pg_hba.conf (1 row) Moreover, is there anyway to view content of this file from stored in above location "Techdb" command prompt itself. Techdb=# cat /etc/postgresql/8.4/main/pg_hba.c

Re: [GENERAL] Questions on PostGreSQL Authentication mechanism...

2010-02-02 Thread dipti shah
Thanks Richard and Alvaro. The "show hba_file" is great solution. Thanks a ton. Could you tell me from where to get all such commands? Thanks, Dip On Mon, Feb 1, 2010 at 9:43 PM, Alvaro Herrera wrote: > dipti shah escribió: > > Thanks Richard. those chapters are very useful. I got to know most of

Re: [GENERAL] Is this the warning message I should pay attention on it, during table partition

2010-02-02 Thread Grzegorz Jaśkiewicz
SET client_min_messages = error; -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general