Re: [SQL] Aggregate query for multiple records

2004-08-26 Thread Josh Berkus
Scott, > Hello, I am new to the list, my apology if this question is beyond the > scope or charter of this list. We have a charter? Why didn't anyone tell me? > My questions is: > What is the best method to perform an aggregate query to calculate > sum() values for each distinct wid as in t

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Josh Berkus
Riccardo, > Looks promising, but still what I need is a proper CVS output, as I > need to review the changes made to the specific database structure. If it's Perl, I'd be interested in contributing. I've long needed something like this myself. -- Josh Berkus Aglio Database Solutions San Fran

[SQL] Pb with insert statement

2004-08-26 Thread Patrice OLIVER
To try to solve my precedent problem (PB with stored procedure), I made this : Table "structure.categtype" Column | Type | Modifiers -+--+--- catcode | varchar(5) | not null catlib | varchar(35) | Indexes: "pk_categtype" primary key, btree (catcode) Table "st

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Greg Stark
"Riccardo G. Facchini" <[EMAIL PROTECTED]> writes: > After searching throught the list, I assume you mean this link: > http://www.rbt.ca/autodoc/index.html > by Rod Taylor. > > Looks promising, but still what I need is a proper CVS output, as I > need to review the changes made to the specific da

Re: [SQL] Problem with stored procedure

2004-08-26 Thread Antonis Antoniou
Patrice OLIVER wrote: Hello, In this example, I use 2 tables : create table types ( typnum integer primary key, catcode varchar(2), typlib varchar(35)); create table uv ( uvnum varchar(5) primary key, typnum integer, uvlib varchar(50)); alter table uv add constraint fk_uv_type foreign key (typnum

Re: [SQL] Problem with stored procedure

2004-08-26 Thread Richard Huxton
Patrice OLIVER wrote: [snip] create function insert_uv(varchar,varchar,varchar) returns integer as ' declare codeuv alias for $1; codetype alias for $2; libuv alias for $3; cletype integer; begin select into cletype numtype(codeuv); insert into uv values (codeuv, cletype, libuv); retu

[SQL] Auto-update script from dumps?

2004-08-26 Thread Joerg Hessdoerfer
Hi! What I'm looking for is something that handles DB schema upgrades. We're building applications which require upgrades to the DB schema over time, so when we upgrade our apps we need to modify the DB. For this, we're using SQL scripts, which basically do incremental updates, e.g. from 1.2 to

[SQL] Problem with stored procedure

2004-08-26 Thread Patrice OLIVER
Hello, In this example, I use 2 tables : create table types ( typnum integer primary key, catcode varchar(2), typlib varchar(35)); create table uv ( uvnum varchar(5) primary key, typnum integer, uvlib varchar(50)); alter table uv add constraint fk_uv_type foreign key (typnum) references type

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Riccardo G. Facchini
--- Kenneth Gonsalves <__> wrote: > On Thursday 26 August 2004 04:48 pm, Philip Warner wrote: > > At 08:43 PM 26/08/2004, Riccardo G. Facchini wrote: > > >If you know of something even similar to what I'm looking for, let > me > > >know. > > > > My thinking is to modify pg_dump to add a new outpu

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Riccardo G. Facchini
--- Philip Warner <__> wrote: > At 08:43 PM 26/08/2004, Riccardo G. Facchini wrote: > >If you know of something even similar to what I'm looking for, let > me > >know. > > My thinking is to modify pg_dump to add a new output format, but I'd > like > to get some more feedback from others first,

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Kenneth Gonsalves
On Thursday 26 August 2004 04:48 pm, Philip Warner wrote: > At 08:43 PM 26/08/2004, Riccardo G. Facchini wrote: > >If you know of something even similar to what I'm looking for, let me > >know. > > My thinking is to modify pg_dump to add a new output format, but I'd like > to get some more feedback

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Philip Warner
At 08:43 PM 26/08/2004, Riccardo G. Facchini wrote: If you know of something even similar to what I'm looking for, let me know. My thinking is to modify pg_dump to add a new output format, but I'd like to get some more feedback from others first, including yourself. Does what I specified before s

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Riccardo G. Facchini
--- Philip Warner <__> wrote: > At 08:04 PM 26/08/2004, Riccardo G. Facchini wrote: > >Does somebody know of a script that does this job? > > No, but a very useful idea. > > Sounds like another dump format to me -- so long as a well-defined > structure that is likely to remain invariant over v

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Philip Warner
At 08:04 PM 26/08/2004, Riccardo G. Facchini wrote: Does somebody know of a script that does this job? No, but a very useful idea. Sounds like another dump format to me -- so long as a well-defined structure that is likely to remain invariant over versions can be used. A client uses a trivial scr

[SQL] from PG_DUMP to CVS

2004-08-26 Thread Riccardo G. Facchini
Hi All, Does somebody know of a script that is capable of creating a CVS tree based on the structure of a given schema or database? I have a development DB that is structured with a lot of tables, functions, views, indexes... I've been asked to publish all the changes under a CVS tree, separating