[GENERAL] Restart after poweroutage

2006-09-24 Thread Jon Lapham
I recently had another electrical power outage that left my machine unable to restart postgresql. I had previously reported this a while ago: http://archives.postgresql.org/pgsql-general/2005-04/msg01286.php Anyway, because I have seen this problem before, I knew exactly what the solution to

Re: [GENERAL] powerset?

2006-09-24 Thread Michael Fuhr
On Sat, Sep 23, 2006 at 11:47:59PM -0600, Michael Fuhr wrote: FOR i IN 0 .. (1 (aupper - alower + 1)) - 1 LOOP To handle empty arrays this should be: FOR i IN 0 .. COALESCE((1 (aupper - alower + 1)) - 1, 0) LOOP -- Michael Fuhr ---(end of

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Richard Broersma Jr
...but for yucks I decided to imagine I did not know. What would I need to do to figure this out. Maybe it is just a right of passage that users of postgresql will just have to learn about this. I would imagine that I am one of the yucks like you. ;-) Anyway, everytime I see a useful

[GENERAL] copy db1 to db2

2006-09-24 Thread Bobby Gontarski
Basically I need to copy db1 to db2 which I create manually. How do I do that, I tried pg_dump pg_restore but I get some errors with foreign key restraint... ---(end of broadcast)--- TIP 4: Have you searched our list archives?

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Martijn van Oosterhout
On Sun, Sep 24, 2006 at 10:11:00AM -0300, Jon Lapham wrote: I recently had another electrical power outage that left my machine unable to restart postgresql. I had previously reported this a while ago: FWIW, I've crashed my machine a lot of times and never run into this problem. However, I

Re: [GENERAL] powerset?

2006-09-24 Thread Ben
Very nice, thanks! On Sep 23, 2006, at 10:47 PM, Michael Fuhr wrote: On Fri, Sep 22, 2006 at 11:38:12PM -0700, Ben wrote: Does anybody have a stored proc they'd like to share (preferably pl/ pgsql) that generates the power set of an array? Here's an attempt: CREATE FUNCTION powerset(a

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Tom Lane
Jon Lapham [EMAIL PROTECTED] writes: I recently had another electrical power outage that left my machine unable to restart postgresql. I had previously reported this a while ago: http://archives.postgresql.org/pgsql-general/2005-04/msg01286.php Anyway, because I have seen this problem

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Joshua D. Drake
This doesn't make sense to me. A reboot will absolutly kill any existing shared memory blocks, how can it possibly be complaining about it? PostgreSQL complains if it finds a postmaster.pid. As far as I can tell it doesn't have anything to do with shared memory except that we are tracking

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Jon Lapham
Tom Lane wrote: Jon Lapham [EMAIL PROTECTED] writes: I recently had another electrical power outage that left my machine unable to restart postgresql. I had previously reported this a while ago: http://archives.postgresql.org/pgsql-general/2005-04/msg01286.php Anyway, because I have seen

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread MaXX
Jon Lapham wrote: [...] I do not *think* I am running 2 postmasters. [EMAIL PROTECTED] ~]# service postgresql stop Stopping postgresql service: [ OK ] [EMAIL PROTECTED] ~]# ps -A | grep -i post [EMAIL PROTECTED] ~]# service postgresql start Starting postgresql

[GENERAL] serial column

2006-09-24 Thread Bob Pawley
I need to develop a serial column that always starts at 1 and is sequential evenafter deletes. Any ideas??? Bob

Re: [GENERAL] serial column

2006-09-24 Thread Gevik Babakhani
On Sun, 2006-09-24 at 13:50 -0700, Bob Pawley wrote: I need to develop a serial column that always starts at 1 and is sequential even after deletes. Any ideas??? Did you try the: create table tbl ( id SERIAL ); or even with primary key... create table tbl ( id SERIAL

Re: [GENERAL] IF EXISTS

2006-09-24 Thread stevethames
Ok, thanks, Jeff. This is not a critical problem. Just annoying. I'll wait for 8.2. BTW, while I can see the reason for adding the IF EXISTS clause to the language for checking the existence of objects, wouldn't it be easier to simply provide the PL/PgSQL language for script loading? Then it

Re: [GENERAL] Table Inheritance / VARCHAR search question

2006-09-24 Thread Simon_Kelly
I would say that splitting the data will work ok if ( and only if ) you can remove some duplication of data and therefore reduce disk usage. If it won't, it'll not really save you anything, and it may increase disk space with the additional db overheads of another set of table meta

[GENERAL] Connecting to PostgreSQL Server

2006-09-24 Thread Lukasz
Hello, I installed a postgresql server on one of the machine in my network with an example IP 192.168.254.102. I have no problem to connect to the server from this machine, but when I want to have access to pgsql server from other pc with an example IP 192.168.254.105 it says that I have no

[GENERAL] how much free space in tables and index ?

2006-09-24 Thread maa1666
Hi, When tuples are deleted, there remains free space in table and index files. Is it possible to know for each table and index how much free space it contains ? Thanks ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please

Re: [GENERAL] Access to databas from the Internet

2006-09-24 Thread Lukasz
Shane Ambler napisal(a): On 20/9/2006 16:55, Lukasz [EMAIL PROTECTED] wrote: Shane Ambler napisal(a): On 19/9/2006 22:41, Lukasz [EMAIL PROTECTED] wrote: Hello, I would like to install a PostgreSQL. I know how to manage the database itself, creae databases, user, groups and so

[GENERAL] in failed sql transaction

2006-09-24 Thread Ralf Wiebicke
Hi all! I just realized the following behaviour in postgresql: when I violate any constraint (unique constraint in my case) then the transaction is not usable anymore. Any other sql command returns a in failed sql transaction error. All other databases I used up to now just ignore the

Re: [GENERAL] Sun Java Studio Creator and PostgreSQL

2006-09-24 Thread Mike Chiarappa
Hello Poul, take a look to thread: http://forum.sun.com/jive/thread.jspa?forumID=123threadID=101711 It works for me !!! :o)) Mike Jim Nasby ha scritto: On Sep 14, 2006, at 4:40 PM, Poul Møller Hansen wrote: I have some troubles getting Sun Java Studio Creator Sun Java Application Server

Re: [GENERAL] postgresql rising

2006-09-24 Thread tober
Ron Johnson wrote: It's a pack/herd mentality that serves the species very well, most of the time. Odd that you should state that, in light of your signature tag line. - -- Ron Johnson, Jr. Jefferson LA USA Is common sense really valid? For example, it is common sense to white-power

Re: [GENERAL] column names in select don't exists in insert to

2006-09-24 Thread Johan
Michael Fuhr schreef: On Wed, Sep 20, 2006 at 02:29:16PM -0700, Johan wrote: I encountered a strange problem while trying to solve a bug. I use a postgresql 8.x database and a jdbc driver from postgresql-8.1dev-400.jdbc3.jar. The following is happening Any reason you're not using the

Re: [GENERAL] What is the Best Postgresql Load Balancing Solution available ?

2006-09-24 Thread Najib Abi Fadel
Hi again,How can i use connection pooling ? Should i use a software like PGPool ? Will the connection pooling boost considerably the performance ?Leonel adviced me to use persistent connections ? hos do i use that ?PS: I am using PHP for my applications.ThanksNajibTalha Khan [EMAIL PROTECTED]

Re: [GENERAL] Connecting to PostgreSQL Server

2006-09-24 Thread viniciusasousa
I am brazilian and have write dificility ,but code pg_hba is: host all all 192.168.254.105/32 md5 and after reload configuration. Belê! ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ?

Re: [GENERAL] serial column

2006-09-24 Thread Bob Pawley
Yes But the only way of insuring that the serial starts at 1 and is sequential is to recreate the table. I've tried creating and dropping the table but this generates other issues which I haven't been able to resolve. Bob - Original Message - From: Gevik Babakhani [EMAIL

Re: [GENERAL] serial column

2006-09-24 Thread Ragnar
On sun, 2006-09-24 at 13:50 -0700, Bob Pawley wrote: I need to develop a serial column that always starts at 1 and is sequential even after deletes. what exactly do you mean? say you have rows where your columns has values 1,2,3 and 4. you now delete the row where the value is 2. what do you

Re: [GENERAL] serial column

2006-09-24 Thread Bob Pawley
Choice a. I am using the numbers to identify devices. If a device is deleted or replaced with another type of device I want the numbering to still be sequential. Bob - Original Message - From: Ragnar [EMAIL PROTECTED] To: Bob Pawley [EMAIL PROTECTED] Cc: Postgresql

Re: [GENERAL] serial column

2006-09-24 Thread Gevik Babakhani
The SERIAL is always sequential. SERIAL internally creates a SEQUENCE and *binds* it to your table. even if you delete a record and insert a new one , the sequence will continue to increment. however there will be gaps between the values. Isn't this the behavior you expect? On Sun, 2006-09-24

Re: [GENERAL] serial column

2006-09-24 Thread Bob Pawley
It's the behavior I expect - but the gaps aren't acceptable. Bob - Original Message - From: Gevik Babakhani [EMAIL PROTECTED] To: Bob Pawley [EMAIL PROTECTED] Cc: Postgresql pgsql-general@postgresql.org Sent: Sunday, September 24, 2006 2:42 PM Subject: Re: [GENERAL] serial column

Re: [GENERAL] serial column

2006-09-24 Thread Ragnar
On sun, 2006-09-24 at 14:29 -0700, Bob Pawley wrote: Choice a. I am using the numbers to identify devices. If a device is deleted or replaced with another type of device I want the numbering to still be sequential. have you tried to implement ths using triggers? gnari

Re: [GENERAL] serial column

2006-09-24 Thread Gevik Babakhani
On Sun, 2006-09-24 at 14:49 -0700, Bob Pawley wrote: It's the behavior I expect - but the gaps aren't acceptable. Bob Then using the SERIAL or SEQUENCE won't do you any good. A possible solution for this would be to regenerate the entire column's values every time a record gets deleted

Re: [GENERAL] serial column

2006-09-24 Thread Bob Pawley
Do you have a for instance?? Bob - Original Message - From: Ragnar [EMAIL PROTECTED] To: Bob Pawley [EMAIL PROTECTED] Cc: Postgresql pgsql-general@postgresql.org Sent: Sunday, September 24, 2006 3:10 PM Subject: Re: [GENERAL] serial column On sun, 2006-09-24 at 14:29 -0700, Bob

Re: [GENERAL] how much free space in tables and index ?

2006-09-24 Thread Michael Fuhr
On Fri, Sep 22, 2006 at 02:11:40AM -0700, [EMAIL PROTECTED] wrote: When tuples are deleted, there remains free space in table and index files. Is it possible to know for each table and index how much free space it contains ? For tables see the contrib/pgstattuple module. -- Michael Fuhr

Re: [GENERAL] serial column

2006-09-24 Thread Bob Pawley
A possible solution for this would be to regenerate the entire column's values every time a record gets deleted starting form 1. but then again this would be very slow if you have a very large table I don't anticipate the table to be more than a few hundred rows - certainly fewer than 1,000.

Re: [GENERAL] how much free space in tables and index ?

2006-09-24 Thread Bruce Momjian
Michael Fuhr wrote: On Fri, Sep 22, 2006 at 02:11:40AM -0700, [EMAIL PROTECTED] wrote: When tuples are deleted, there remains free space in table and index files. Is it possible to know for each table and index how much free space it contains ? For tables see the contrib/pgstattuple

Re: [GENERAL] column names in select don't exists in insert to

2006-09-24 Thread Michael Fuhr
On Thu, Sep 21, 2006 at 01:32:47AM -0700, Johan wrote: Someone executed the query in psql for me and the problem seems to be in a stored procedure triggered after update. This procedure complains about the field. Were you able to fix the problem or are you still uncertain what the problem is?

Re: [GENERAL] serial column

2006-09-24 Thread Gevik Babakhani
On Sun, 2006-09-24 at 15:29 -0700, Bob Pawley wrote: A possible solution for this would be to regenerate the entire column's values every time a record gets deleted starting form 1. but then again this would be very slow if you have a very large table I don't anticipate the table to be more

Re: [GENERAL] serial column

2006-09-24 Thread Tom Lane
Bob Pawley [EMAIL PROTECTED] writes: I am using the numbers to identify devices. If a device is deleted or replaced with another type of device I want the numbering to still be sequential. It sounds to me like you oughtn't be storing these numbers in the database at all. You just want to

Re: [GENERAL] serial column

2006-09-24 Thread Bob Pawley
Thanks I'll give that a try. Bob - Original Message - From: Gevik Babakhani [EMAIL PROTECTED] To: Bob Pawley [EMAIL PROTECTED] Cc: Postgresql pgsql-general@postgresql.org Sent: Sunday, September 24, 2006 4:13 PM Subject: Re: [GENERAL] serial column On Sun, 2006-09-24 at 15:29

Re: [GENERAL] in failed sql transaction

2006-09-24 Thread Michael Fuhr
On Sun, Sep 24, 2006 at 12:03:59PM +0200, Ralf Wiebicke wrote: I just realized the following behaviour in postgresql: when I violate any constraint (unique constraint in my case) then the transaction is not usable anymore. Any other sql command returns a in failed sql transaction error.

[GENERAL] query rewrite rules for updateable views?

2006-09-24 Thread Markus Grabner
Hi! As far as I understand, one can simulate updateable views in PostgreSQL by providing appropriate query rewrite rules. Is there any tool to automatically create these rules for a given set of table and view definitions? Kind regards, Markus -- Markus

Re: [GENERAL] serial column

2006-09-24 Thread Adrian Klaver
On Sunday 24 September 2006 02:29 pm, Bob Pawley wrote: Choice a. I am using the numbers to identify devices. If a device is deleted or replaced with another type of device I want the numbering to still be sequential. Bob Do you have some other way of tracking a device? I am just trying

Re: [GENERAL] serial column

2006-09-24 Thread Bob Pawley
To some degree I don't care about the actual number other than roughly following the device ID. At some point later in the design the numbers will be updated to project numbers and then frozen. Bob - Original Message - From: Adrian Klaver [EMAIL PROTECTED] To:

Re: [GENERAL] serial column

2006-09-24 Thread Bob Pawley
The numbering system is more complex than just assigning a number. It invloves about thirty procedures which I have put together and find that it works well. I would like to keep the numbering as a database system which will be possible if I can figure out a way of generating sequential

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Adrian Klaver
On Sunday 24 September 2006 09:17 am, Tom Lane wrote: Jon Lapham [EMAIL PROTECTED] writes: I recently had another electrical power outage that left my machine unable to restart postgresql. I had previously reported this a while ago:

Re: [GENERAL] serial column

2006-09-24 Thread Adrian Klaver
You might want to take a look at- http://www.varlena.com/GeneralBits/ The procedure as shown does not account for renumbering after a delete, but it might serve as a starting point. On Sunday 24 September 2006 07:03 pm, Bob Pawley wrote: The numbering system is more complex than just

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Alvaro Herrera
Jon Lapham wrote: [EMAIL PROTECTED] ~]# ps -A | grep -i post 30760 ?00:00:00 postmaster 30762 ?00:00:00 postmaster 30764 ?00:00:00 postmaster 30765 ?00:00:00 postmaster 30766 ?00:00:00 postmaster ...is that normal to see 5 of them running? Yes,

Re: [GENERAL] Connecting to PostgreSQL Server

2006-09-24 Thread Shane Ambler
On 21/9/2006 18:36, Lukasz [EMAIL PROTECTED] wrote: Hello, I installed a postgresql server on one of the machine in my network with an example IP 192.168.254.102. I have no problem to connect to the server from this machine, but when I want to have access to pgsql server from other pc with

Re: [GENERAL] query rewrite rules for updateable views?

2006-09-24 Thread A. Kretschmer
am Mon, dem 25.09.2006, um 2:56:47 +0200 mailte Markus Grabner folgendes: Hi! As far as I understand, one can simulate updateable views in PostgreSQL by providing appropriate query rewrite rules. Is there any tool to automatically create these rules for a given set of table