[GENERAL] Alter field type?

2004-08-26 Thread Bjørn T Johansen
Is it possible to alter field type (from varchar to text) without making a new table? Regards, BTJ -- --- Someone wrote: "I understand that if you play a Windows CD backwards you hear strange Satanic mess

Re: [GENERAL] ALTER TABLE - add several columns

2004-08-26 Thread Janning Vygen
Am Donnerstag, 26. August 2004 08:30 schrieb Fuchs Clemens: > Hi, > > I just want to add several columns to an existing table. Do I have to call > a statements like below for each new column, or is there a possibility to > do it at once? > > - existing table: test > - columns to add:

Re: [GENERAL] Querying large record sets

2004-08-26 Thread Martijn van Oosterhout
On Wed, Aug 25, 2004 at 09:25:51PM -0700, Jon Asher wrote: > Hi, > > Our new Postgres database includes a table with about 1 mil records. So > far, I've been impressed with the performance of queries against 1 mil rows. > Unfortunately I just found out that the size of the table will increase to

Re: [GENERAL] Constraints to Guarantee unique across tables with foreign key?

2004-08-26 Thread Janning Vygen
Am Donnerstag, 26. August 2004 04:43 schrieb Benjamin Smith: > I have two tables like following: > > create table attendancereport ( > id serial unique not null, > staff_id integer not null references staff(id), > schoolyear varchar not null references schoolyear(year), > students_id integer not nu

Re: [GENERAL] copy a database

2004-08-26 Thread David Suela Fernández
El mié, 25-08-2004 a las 20:54, Tom Lane escribió: > David Suela =?ISO-8859-1?Q?Fern=E1ndez?= <[EMAIL PROTECTED]> writes: > > The problem is that pg_dump always give me the next error: > > > pg_dump: SQL command failed > > pg_dump: Error message from server: ERROR: relation "pg_user" does not exi

Re: [GENERAL] Possible to insert quoted null value into integer field?

2004-08-26 Thread gnari
"Pablo S" <[EMAIL PROTECTED]> wrote: > Hi all, I have search high and low on this - > > Take for instance the statement : > > insert into foo (text1, text2, int1) values ('Foo', 'Bar', ''); > > On Pg 7.2.x, the db would happily insert the null val into the int > field. HOWSOMEVER, 7.4.x wil

Re: [GENERAL] Alter field type?

2004-08-26 Thread Tino Wildenhain
Hi, Am Do, den 26.08.2004 schrieb Bjørn T Johansen um 9:48: > Is it possible to alter field type (from varchar to text) without making > a new table? In 8.0 I think. Common practice in 7.4.x is: BEGIN work; ALTER TABLE yourtable ADD COLUMN tempcolumn text; UPDATE yourtable SET tempcolumn = ori

Re: [GENERAL] Alter field type?

2004-08-26 Thread Greg Stark
Bjørn T Johansen <[EMAIL PROTECTED]> writes: > Is it possible to alter field type (from varchar to text) without making a new > table? You can add a new column, update the table to set the new column to the old value. then drop the old column. Then you might want to vacuum full the table. In 8.

[GENERAL] Stored procedure failure

2004-08-26 Thread Michal Hlavac
hello, I have interesting problem... I have stored procedure, which works good, but only if input is "correct". Correct input is, when $1 is id, which exists in table... If I put non exists id, database fall down and restart with this error: server closed the connection unexpectedly This pr

Re: [GENERAL] Alter field type?

2004-08-26 Thread Bjørn T Johansen
That looks like a recipe, thx... :) BTJ Tino Wildenhain wrote: Hi, Am Do, den 26.08.2004 schrieb Bjørn T Johansen um 9:48: Is it possible to alter field type (from varchar to text) without making a new table? In 8.0 I think. Common practice in 7.4.x is: BEGIN work; ALTER TABLE yourtable ADD COL

Re: [GENERAL] Alter field type?

2004-08-26 Thread Markus Bertheau
On 26 Aug 2004 04:36:18 -0400, Greg Stark <[EMAIL PROTECTED]> wrote: > > Bjørn T Johansen <[EMAIL PROTECTED]> writes: > > > Is it possible to alter field type (from varchar to text) without making a new > > table? > > You can add a new column, update the table to set the new column to the old >

[GENERAL] stone-age maintenance procedures ;-)

2004-08-26 Thread Ulrich Wisser
Hi, lately I've been acused of "stone-age maintenance procedures". Hopefully I will find some help to develop from stone-age to roman empire. ;-) To optimize the performance and to minimize the maintainance needs I would like to ask you guys about some values in my postgresql.conf. select versi

Re: [GENERAL] Stored procedure failure

2004-08-26 Thread Richard Huxton
Michal Hlavac wrote: hello, I have interesting problem... I have stored procedure, which works good, but only if input is "correct". Correct input is, when $1 is id, which exists in table... If I put non exists id, database fall down and restart with this error: server closed the connection unexpec

Re: [GENERAL] Stored procedure failure

2004-08-26 Thread Michal Hlavac
Michal Hlavac wrote: > hello, I have interesting problem... > > I have stored procedure, which works good, but only if input is "correct". > Correct input is, when $1 is id, which exists in table... > If I put non exists id, database fall down and restart with this error: > server closed the conne

Re: [GENERAL] Stored procedure failure

2004-08-26 Thread Michal Hlavac
Richard Huxton wrote: Looking at the 8.0beta source, the functions (...ltree_isparent) are all marked strict so they should just return null on a null parameter. What happens if you set my_path to some non-null but un-matched value before the problem line? When my_path have non-null value, ever

[GENERAL] Trigger question

2004-08-26 Thread Daniel Schuchardt
Hi list, i'm a bit confused. I have a table with a trigger after insert. It is possible that this trigger will do inserts in the same table, but is the after insert trigger fired again in this case? (I would need this) e.g. USER INSERT BEFORE TRIGGER AFTER TRIGGER ->DECIDES TO INSERT X ROWS IN T

Re: ltree bug handling nulls (was [GENERAL] Stored procedure failure)

2004-08-26 Thread Richard Huxton
Michal Hlavac wrote: Richard Huxton wrote: Looking at the 8.0beta source, the functions (...ltree_isparent) are all marked strict so they should just return null on a null parameter. What happens if you set my_path to some non-null but un-matched value before the problem line? When my_path have

[GENERAL] unsubscribe

2004-08-26 Thread Robert Deme
unsubscribe

Re: [GENERAL] Problem to connect to the Windows Port

2004-08-26 Thread Anony Mous
I've been watching this thread because I am experience exactly the same thing. I can also repeat all the diagnostic results of Conni. Postmaster resides on a Win 2K box. I can telnet to the server no problem. My pg_hba file line entries will allow access from all hosts, all users, all databases

Re: [GENERAL] stone-age maintenance procedures ;-)

2004-08-26 Thread Christopher Browne
A long time ago, in a galaxy far, far away, [EMAIL PROTECTED] (Ulrich Wisser) wrote: > select version(); > > PostgreSQL 7.3.4 on i386-redhat-linux-gnu, compiled by GCC > i386-redhat-linux-gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) > (1 row) Happily, that's not _scary_ obsolete. There's st

[GENERAL] detecting a dead db not seeming to work

2004-08-26 Thread Graeme Hinchliffe
Hiya I have now managed to get my code to function correctly for a none present db, and one that is shutdown whilst it is being used. In both cases my code functions and happily recovers on the db's return. However one of the tests I performed was to kill -9 the postmaster process to se

Re: [GENERAL] Problem to connect to the Windows Port

2004-08-26 Thread Anony Mous
OK, I've found what worked for me. By default, the pg_hba file installs like so: # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD local all all trust # IPv4-style local connections: host all all 127.0.0.1 255.255.255.255 trust # IPv6-style local connections: host all all ::1 :::ff

Re: [GENERAL] copy a database

2004-08-26 Thread Tom Lane
David Suela =?ISO-8859-1?Q?Fern=E1ndez?= <[EMAIL PROTECTED]> writes: > It return: > ERROR: permission denied to create "pg_catalog.pg_user" > DETAIL: System catalog modifications are currently disallowed. > How can i change this permissions? IIRC, you need to run a standalone backend, with eithe

Re: [GENERAL] stone-age maintenance procedures ;-)

2004-08-26 Thread Tom Lane
Ulrich Wisser <[EMAIL PROTECTED]> writes: > max_fsm_relations = 1 > max_fsm_pages = 10 > The total database size on disk is ~6GB. Most likely, you need larger max_fsm_pages. 6GB would work out to about 750K pages (of 8K each). With max_fsm_pages of 100K you are saying that you don't exp

Re: [GENERAL] copy a database

2004-08-26 Thread Guy Fraser
Have you tried to use "copy" to export the data from each table? As a last resort you could try this, since you said you can still select data from the tables. Make a list of tables then : sed -e "/^.*/copy & TO '&.sql';/" table.list | psql database This should create a file for each table ending w

[GENERAL] space taken by a row & compressed data

2004-08-26 Thread Leonardo Francalanci
With mysql I know how much space a row will take, based on the datatype of it columns. I also (approximately) know the size of indexes. Is there a way to know that in postgresql? Is there a way to pack (compress) data, as with myisampack for mysql? Thank you ---(end of

Re: [GENERAL] detecting a dead db not seeming to work

2004-08-26 Thread Tom Lane
Graeme Hinchliffe <[EMAIL PROTECTED]> writes: > However one of the tests I performed was to kill -9 the postmaster > process to see how it would handle that (assuming the same behaviour). > However nothing happens! no segfault, no db connection failure etc. That's the intended behavior on postm

Re: [GENERAL] detecting a dead db not seeming to work

2004-08-26 Thread Graeme Hinchliffe
On Thu, 2004-08-26 at 15:57, Tom Lane wrote: > Graeme Hinchliffe <[EMAIL PROTECTED]> writes: > > However one of the tests I performed was to kill -9 the postmaster > > process to see how it would handle that (assuming the same behaviour). > > However nothing happens! no segfault, no db connection