Re: [SQL] Create Primary Key?

2000-08-30 Thread D'Arcy J.M. Cain
Thus spake Stephan Szabo > We don't currently support the SQL syntax for adding > a PK to a table. However, if you have the columns > as NOT NULL already, adding a unique index to the > columns in question has the same general effect. Except for interfaces such as PyGreSQL that recognize the pri

Re: [SQL] Create Primary Key?

2000-08-30 Thread Stephan Szabo
On Wed, 30 Aug 2000, D'Arcy J.M. Cain wrote: > Thus spake Stephan Szabo > > We don't currently support the SQL syntax for adding > > a PK to a table. However, if you have the columns > > as NOT NULL already, adding a unique index to the > > columns in question has the same general effect. > >

Re: [SQL] Viewing a function

2000-08-30 Thread Ryan Williams
Try "SELECT prosrc FROM pg_proc WHERE proname = 'funcname'", where funcname is the name of the function you want to see. - Original Message - From: "stuart" <[EMAIL PROTECTED]> To: "PG-SQL" <[EMAIL PROTECTED]> Sent: Tuesday, August 29, 2000 3:20 AM Subject: Fw: [SQL] Viewing a function

Re: [SQL] Optimizing huge inserts/copy's

2000-08-30 Thread Jie Liang
Hi, there, I tried different ways, include vaccum table , ensure index works, it still is as slow as ~100rows per minute. Stephan Szabo wrote: > On Tue, 29 Aug 2000, Jie Liang wrote: > > > Hi, there, > > > > 1. use copy ... from '.'; > > 2. write a PL/pgSQL function and pass multiple re

Re: [SQL] Optimizing huge inserts/copy's

2000-08-30 Thread Webb Sprague
I am experimenting with this too. If I have any indexes at all, the copy's get VERY SLOW as the table gets big. Delete ALL your indexes, do your copy's, and then create your indexes again. Good luck. --- Jie Liang <[EMAIL PROTECTED]> wrote: > Hi, there, > > I tried different ways, include va

Re: [SQL] Optimizing huge inserts/copy's

2000-08-30 Thread Jie Liang
Hi, I knew that if no constarint, it populate very quick, my question is: when two tables have been reloaded, then I want to add a foreign key constraint to it, say: tableA has primary key column (id) tableB has a column (id) references it, so I say: ALTER TABLE tableB ADD CONSTRAINT distfk FOREI

Re: [SQL] Optimizing huge inserts/copy's

2000-08-30 Thread Stephan Szabo
On Wed, 30 Aug 2000, Jie Liang wrote: > Hi, > > I knew that if no constarint, it populate very quick, my question is: > when two tables have been > reloaded, then I want to add a foreign key constraint to it, say: > tableA has primary key column (id) > tableB has a column (id) references it, so

Re: [SQL] Optimizing huge inserts/copy's

2000-08-30 Thread Tom Lane
Webb Sprague <[EMAIL PROTECTED]> writes: > I am experimenting with this too. If I have any > indexes at all, the copy's get VERY SLOW as the table > gets big. Delete ALL your indexes, do your copy's, > and then create your indexes again. Do you have a lot of equal index keys in the data you're

[SQL] 7.0.2 questions on encoding and compilation

2000-08-30 Thread pyz
Currently, I'm using the the 7.0.2 rpms from the postgresql.org on a RH6.2 install. I have a few questions on it and the use of the -E flag. 1 - can 7.0.2 be optimized for i686 architecture or is it only possible to compile for i386 architecture? 2 - Can createdb -E someencoding be used "strai

[SQL] Re: [ADMIN] 7.0.2 questions on encoding and compilation

2000-08-30 Thread Max Pyziur
On Wed, 30 Aug 2000, Dana Hudes wrote: > I have compiled for i686 by hacking up my RPM compile environment. Exactly, what settings do you use? MP > On Wed, 30 Aug 2000 [EMAIL PROTECTED] wrote: > > > Currently, I'm using the the 7.0.2 rpms from the postgresql.org > > on a RH6.2 install. > >

[SQL] function

2000-08-30 Thread Normunds
Hi all, how can I write function which takes text from one field, replaces some characters and puts it in other field? I have array with old and new values. For example: old array = {'r', 'Z', 'o'} new array = {'s', 'm', 't'} old field value = 'Zorro' new field value which must calculate this fu

[SQL] Re: [GENERAL] function

2000-08-30 Thread Jan Wieck
Normunds wrote: > Hi all, > > how can I write function which takes text from one field, replaces > some characters and puts it in other field? I have array with old and > new values. > > For example: > old array = {'r', 'Z', 'o'} > new array = {'s', 'm', 't'} > old field value = 'Zorro' > new fiel