[SQL] Tuple size limit.

2000-08-18 Thread Christopher Sawtell
Greetings pg world, I have been asked to look into making a relatively simple db app. in which the tuple size will quite probably grow to more than the 32kbytes limit offered by recompiling. I understand that the 7.1 release currently in CVS does not have this limitation. So I'd like to know if

[SQL] Creating sequences

2000-08-18 Thread Adam Lang
Is it possible to have a sequence (or something like it) when it increments alpha-numeric? Say the first value is set at A01 and it will increment to A02, A03 by default. Also, it would be good if it could be made the primary key. Adam Lang Systems Engineer Rutgers Casualty Insurance Company

RE: [SQL] sequences in functions

2000-08-18 Thread Graham Vickrage
I have noticed that you can only pass 16 parameters to a function, I was therefore wondering how you can do atomic inserts (such as the function below but with more params) using pl/pgsql if you can't pass complex data types. Is this something that transactions are not used for or is it best done

[SQL] Re: [HACKERS] [Fwd: Optimization in C]

2000-08-18 Thread Thomas Lockhart
> This solution isn't good when there are +1 tuples in the table, it's > slowly... anybody can help me ? : Someone already responded, and asked some questions about what you are really trying to do. If you didn't get the message, let us know or check the mail archives. Regards.

Re: [GENERAL] Re: [SQL] variables in SQL??

2000-08-18 Thread Craig Johannsen
You can create a running total provided that you have a unique sequentially increasing (or decreasing) ID for each row. See the following example: create table tran(id int primary key, price dec(8,2)); insert into tran values(1,5.00); insert into tran values(2,4.00); insert into tran values(3,10

Re: [SQL] update rule loops

2000-08-18 Thread Stephan Szabo
On Fri, 18 Aug 2000, Poul L. Christiansen wrote: > Hi > > I'm trying to make a field in my table (datechanged) to automatically be > updated with the value 'now()' when an update on the table occurs. > > plc=# create rule datechanged_radius AS ON update to radius do update > radius set datecha

Re: [SQL] Continuous inserts...

2000-08-18 Thread Stephan Szabo
On Fri, 18 Aug 2000, Joerg Hessdoerfer wrote: > Good idea - I immediately tested it - rules rule! That seems to work perfectly, > and the client doesn't even see it happen (except for 'selects', one would > have to setup > a rule to return something meaningful then...). > > I did: > Two tables,

[SQL] update rule loops

2000-08-18 Thread Poul L. Christiansen
Hi I'm trying to make a field in my table (datechanged) to automatically be updated with the value 'now()' when an update on the table occurs. plc=# create rule datechanged_radius AS ON update to radius do update radius set datechanged ='now()'; CREATE 22025360 1 plc=# update radius set destinat

Re: [SQL] sequences in functions

2000-08-18 Thread Yury Don
Hello Graham, Friday, August 18, 2000, 6:24:15 PM, you wrote: GV> I am having problems referencing sequeces in a function, I think because of GV> the '' characters. The function I am creating is a follows: - GV> CREATE FUNCTION InsertClient ( varchar, varchar, varchar, varchar, varchar, GV> var

[SQL] sequences in functions

2000-08-18 Thread Graham Vickrage
I am having problems referencing sequeces in a function, I think because of the '' characters. The function I am creating is a follows: - CREATE FUNCTION InsertClient ( varchar, varchar, varchar, varchar, varchar, varchar ) RETURNS int4 AS ' DECLARE id INT; BEGIN SELECT nextval('c

Re: [SQL] Continuous inserts...

2000-08-18 Thread Joerg Hessdoerfer
Hi! At 11:57 18.08.00 +0100, you wrote: >I'm not familiar with rules. Could you please post the SQL for creating >the rule >that you've created? Here we go (if memory serves ;-) create table a ( num int4, name text ); create table b ( num int4, name text ); rule to insert into b instead of a:

Re: [SQL] Continuous inserts...

2000-08-18 Thread Poul L. Christiansen
I'm not familiar with rules. Could you please post the SQL for creating the rule that you've created? I going to make such a setup in the near future and this seems to . Joerg Hessdoerfer wrote: > Hi! > > Thanks all for your input... > > At 09:15 17.08.00 -0700, you wrote: > [...] > > > Questio

[SQL] [Fwd: Optimization in C]

2000-08-18 Thread Jerome Raupach
This solution isn't good when there are +1 tuples in the table, it's slowly... anybody can help me ? : string = "SELECT service, noeud, rubrique FROM table" ; res = PQexec( conn, string.data() ) ; if ( (! res) || (status = PQresultStatus( res ) != PGRES_TUPLES_OK)

Re: [SQL] Continuous inserts...

2000-08-18 Thread Joerg Hessdoerfer
hi! At 11:38 17.08.00 -0700, you wrote: >Hi All. > >Shouldn't Postgres block while vacuuming, and then >continue inserting starting where it left off? Is the >time lag too much? For me - yes. My app can accept some hundredes of ms time lag - not seconds or, like with a VACUUM, minutes (I've see

Re: [SQL] Continuous inserts...

2000-08-18 Thread Joerg Hessdoerfer
Hi! Thanks all for your input... At 09:15 17.08.00 -0700, you wrote: [...] > > Question: would it work to use a transaction to perform the rename? > > > > i.e.: continuous insert into table 'main' from client. > > > > From somewhere else, execute: > > > > begin; > > alter table main rename to v

[SQL] database design and diagraming book recommendations..

2000-08-18 Thread Francisco Hernandez
anyone know of a good book or books on database modeling? like for entity relationship diagrams and such.. thanks!