RE: [GENERAL] Re: [SQL] database design and diagraming book recommendations..

2000-08-21 Thread Craig L. Ching
> "Francisco Hernandez" <[EMAIL PROTECTED]> > > > anyone know of a good book or books on database modeling? > > like for entity relationship diagrams and such.. > > > To get a good life, go with Chris Date's rather difficult two > volume set. > What are the names of these two books? I just

Re: [SQL] 8K Limit, whats the best strategy?

2000-08-21 Thread Jan Wieck
Poul L. Christiansen wrote: > I've just split the text up (in 8 pieces), so it fits into 8K rows. But thats > only a viable solution if your text is less than a couple of 100K's. > > You could try to be a daredevil and use the Toast code, even if it's beta. But > I don't know how far the Toast pro

Re: [SQL] Copying data with triggers

2000-08-21 Thread Tom Lane
Keith Wong <[EMAIL PROTECTED]> writes: > create function tp_info () returns opaque as ' > begin > -- insert into audit table > insert into AudInfo (info_id, some_data, aud_operation_type) values > (new.info_id, new.some_data, ''i''); > return new; >

[SQL] copy DELETES to audit table

2000-08-21 Thread jason watkins
I'd like to have a trigger that does something like serialize any row to a text string, then copys it into an audit table befor allowing the delete... having an restore function that can deserialize would be nice as well, but not criticle.. the goal would be to allow a couple people who need the

[SQL] Copying data with triggers

2000-08-21 Thread Keith Wong
Hi all, In the database I'm designing, I want to have audit tables that keep a log of all inserts, updates and deletes that occur on any table. e.g. If i had a table Info, create table Info ( info_id SERIAL, some_data text ) I would also have a corresponding audit ta

Re: [SQL] 8K Limit, whats the best strategy?

2000-08-21 Thread Jan Wieck
Poul L. Christiansen wrote: > Jan Wieck wrote: > > > Poul L. Christiansen wrote: > > > I've just split the text up (in 8 pieces), so it fits into 8K rows. But thats > > > only a viable solution if your text is less than a couple of 100K's. > > > > > > You could try to be a daredevil and use the To

Re: [SQL] Creating sequences

2000-08-21 Thread Adam Lang
This is what I wanted to do. When I can have a primary key that is meaningful AND won't change, I would like to try to use it, otherwise I'd probably use an OID. So... I'm developing a database that will have the primary key like a "case number" (like when you call for tech support). Say your c

Re: [SQL] Best way to create DML/DDL log?

2000-08-21 Thread Ingram, Bryan
Thanks Webb and Yury .. Those are good ideas, but as it stands, I believe the debugging facility is inadequate for my needs. I have several databases set up on one machine (postgres calls this a "cluster") and I need the log to specify which database, and ideally, which user, the log entry is fo

[SQL] Upper case or lower case....

2000-08-21 Thread Franz J Fortuny
This statement: create table tabname ( field1 integer, field2 integer ); creates a table with tablename "tabname", lower case or IRRELEVANT CASE? Also, field1 is "field1" (all lower case) or is it case irrelevant? The problem we are having is that those queries we have working for our commer

[SQL] Speed or configuration

2000-08-21 Thread Franz J Fortuny
The Hermit Hacker wrote: "use cut-n-paste please, and send us the results of the EXPLAIN ... stuff like the cost estimates and whatnot tell us *so* much ..." This is it: exis=# \d pvdprcod NUMART| integer | not null NUMDEP| smallint| not null NUMPRO| smallint| not nul

[SQL] NULL function arguments?

2000-08-21 Thread Mark Volpe
It seems that why I provide a NULL argument to a PL/pgSQL function it makes the rest of the arguments NULL, too! Consider this function: CREATE FUNCTION callme(text, text) RETURNS boolean AS ' BEGIN RAISE NOTICE ''$1: %'', $1; RAISE NOTICE ''$2: %'', $2;

Re: [SQL] Re: Beginner problems with functions

2000-08-21 Thread Stephan Szabo
On Mon, 21 Aug 2000, Andreas Tille wrote: > On Thu, 17 Aug 2000, Stephan Szabo wrote: > > > What you may need to do is declare a variable of type record > > and do SELECT INTO * From ... rather than just > > the SELECT. > Thanks, that worked. > > > Yeah, setof seems fairly wierd. SETOF ba

Re: [SQL] Best way to create DML/DDL log?

2000-08-21 Thread Webb Sprague
I think there is either a switch to the psql client or a "\" command in the session that allows you to log to a file. Even if you have to do some redirection, it seems a lot better than modifying postgres.c (though I am quite impressed that you would think about it...) --- "Ingram, Bryan" <[EMAI

[SQL] Best way to create DML/DDL log?

2000-08-21 Thread Ingram, Bryan
I would like to create a long of all successful DML/DDL statements. Has anyone accomplished this before? No need to reinvent the wheel ... If not ..I'm wondering what the best approach might be. I have looked at the tcop/postgres.c source, thinking I might start by modifying some of the -dX ro

Re: [SQL] 8K Limit, whats the best strategy?

2000-08-21 Thread Poul L. Christiansen
Jan Wieck wrote: > Poul L. Christiansen wrote: > > I've just split the text up (in 8 pieces), so it fits into 8K rows. But thats > > only a viable solution if your text is less than a couple of 100K's. > > > > You could try to be a daredevil and use the Toast code, even if it's beta. But > > I do

[SQL] Re: Beginner problems with functions

2000-08-21 Thread Andreas Tille
On Thu, 17 Aug 2000, Stephan Szabo wrote: > What you may need to do is declare a variable of type record > and do SELECT INTO * From ... rather than just > the SELECT. Thanks, that worked. > Yeah, setof seems fairly wierd. SETOF basetype if > you do a SELECT FROM table seems to work though

Re: [SQL] update syntax error?

2000-08-21 Thread mikeo
query should have a comma instead of the word and... HTH mikeo At 04:27 PM 8/20/00 -0300, The Hermit Hacker wrote: > >UPDATE SET field1=,field2= > >On Tue, 15 Aug 2000, k.c. hemelstrand wrote: > >> Can anybody help with why I am receiving the error below? >> >> Thanks >> K.C. >> >> >> parts=