[SQL] Data modelling tools

2000-06-01 Thread Jorge Garcia

Hello,

I'm looking for data modelling software tools, and at first glance I'm
not sure about what logic model is more appropiated.

Database books usually refer to the E-R model, but UML is a more general
approach. I've tried an old release of ERWin (2.5), and Assimetrix
Infomodeller 1.5, which no longer exists, as I know.

Some ideas?. Are there more recent software for this job?


begin:vcard 
n:Garcia;Jorge
tel;fax:34 91 562 68 13
tel;work:34 91 411 74 80
x-mozilla-html:TRUE
url:http://www.inner.es
org:INNER Research
adr:;;cl Velázquez 109;Madrid;;28006;SPAIN
version:2.1
email;internet:[EMAIL PROTECTED]
title:Director del Sistema de Información
x-mozilla-cpt:;0
fn:JorgeGarcia
end:vcard



[SQL] SQL Server and C++ Data Types

2000-06-01 Thread Jason . Weiss



I am trying to convert my C++ data types into SQL Server data types. I
found a short list on Microsoft's website, but it did not list all of the
types. I was wondering if you could give me a list of the conversions or
could direct me where to go.





Re: [SQL] textpos() in postgreSQL 7.0

2000-06-01 Thread Ross J. Reedstrom

Adam - 
Looks like it was renamed to strpos() in 7.0. A quick compatability 
hack to get up and running until you can rewrite the code would be to 
do something like:

CREATE FUNCTION textpos (text,text) RETURNS int AS 'SELECT strpos($1,$2)'
LANGUAGE 'SQL';

Now all your old code will work, just a little slower.

Ross

On Thu, Jun 01, 2000 at 07:47:32AM +0200, Adam Walczykiewicz wrote:
> Hi
> I notice that string function textpos() doesn't exist in postgreSQL 7.0. I
> have some
> plpgsql functions written for 6.5.2 that use textpos() and when I tried to
> use them
> in postgreSQL 7.0 I'v got error. 
-- 
Ross J. Reedstrom, Ph.D., <[EMAIL PROTECTED]> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005



Re: [SQL] SQL'92 web resources

2000-06-01 Thread Bruce Momjian

Shouldn't we have links to these on our web site?


> De Moudt Walter wrote:
> 
> > Stoyan
> > The only reference I found is at http://www.ansi.org
> > They guard the standard. But they charge you for reviewing the document
> > :-( and it's not cheap either
> > a search on sql-92 delivers a huge result, but i doubt if the document
> > can be viewed online elsewhere then with ansi.org
> >
> > Stoyan Genov wrote:
> > >
> > > Hello,
> > >
> > > Where on the 'Net can I find SQL'92 specifications/standards ?
> > >
> > > Thank you.
> > >
> > > Regards,
> > > Stoyan Genov
> > >
> > > 
> >
> > 
> 
> I found a huge document there, more than 700 pages
> It's only text, more than 1.5 meg. The title is :
> Proposed revised text of DIS 9075
> and the URL is :
> http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
> Hoping it may help
> 
> 
> 
> 
> 


-- 
  Bruce Momjian|  http://www.op.net/~candle
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026



[SQL] short query becomes long

2000-06-01 Thread mikeo

hi,
  we have a weird situation here.  we have a table of approx. 10k rows
representing accumulated activity by specific customers.  as information 
is gathered those customers rows are updated.  the number of rows does not
increase unless we get a new customer so that is not a factor.  the table 
is defined as follows:

  Table "account_summary_02"
  Attribute  |Type | Modifier
-+-+--
 bill_br_id  | bigint  | not null
 cust_id | varchar(15) | not null
 btn_id  | varchar(15) | not null
 ln_id   | varchar(15) | not null
 ct_key  | float8  | not null
 as_quantity | float8  | not null
 as_charges  | float8  | not null
 as_count| float8  | not null
Index: account_summary_02_unq_idx

the index is on the first 5 columns.  here's the situation.  after about
50,000
updates, which fly right along, the process begins to really bog down.  we
perform 
a vacuum analzye and it speeds right up again.  my question is, is there a way
to perform these updates, potentially 500k to 1 million in a day, without
having 
to vacuum so frequently?  maybe some setting or parameter to be changed?
the update
query is doing an index scan.  

mikeo 




[SQL] I'm missing outer joins

2000-06-01 Thread bill


Hello!

Well, I have a need for an OUTER JOIN, but have semi-solved it by using
a UNION. However, I can't do an ORDER BY on a UNION, and have since
discovered that a VIEW can not be used with a UNION.

Is there another way (possibly with one or more FUNCTIONs), for me to get
this join on two tables (where one table may have no matching rows) via a
single sorted query?

Thanks!

Bill




[SQL] Simulating CURSORS??

2000-06-01 Thread p . lam

I read from messages like 
http://www.postgresql.org/mhonarc/pgsql-sql/1999-11/msg00076.html that CURSORS could 
not be used with pg/plsql, and indeed attempting to do so result in the same kind of 
error highlighted in that message.
Are there any other ways I could with pgplsql simuate the use of Cursors and write 
functions that could fetch and process records row by row retrieved from a SELECT 
statement (and then put the processed data back to another table)?



Get your free email from AltaVista at http://altavista.iname.com



Re: [SQL] short query becomes long

2000-06-01 Thread Tom Lane

mikeo <[EMAIL PROTECTED]> writes:
> after about 50,000 updates, which fly right along, the process begins
> to really bog down.  we perform a vacuum analzye and it speeds right
> up again.

A plain "vacuum" should do the job in a bit less time.  The problem
is you need to reclaim the space occupied by deleted versions of rows.
No way around that with the current storage manager: vacuum is the
only way to get rid of the wasted space.

regards, tom lane



[SQL] creating rules on joined views

2000-06-01 Thread Brian Powell

D'oh sorry for the subscribe message to the list...

Greetings, I am new to PostGreSQL and the advanced capabilities that it
offers.  I would like to create a joined view that allows inserts and
updates on two different tables (but, joined twice).

Suppose you have:


create table user {
  name  varchar(40) not null,
  email varchar(80),
  address_idint4 not null,
  shipping_address_id   int4 not null
};

create table addresses {
  address_idint4 primary key default nextval('address_seq_id'),
  address   varchar(80),
  city  varchar(80)
};

create view v_users as
select u.name
  , u.email
  , a1.address
  , a1.city
  , a2.address as ship_address
  , a2.city as ship_city
from user u
  , addresses a1
  , addresses a2
where u.address_id = a1.address_id
  and u.shipping_address_id = a2.address_id


Now, how would I create an insert rule on v_users because I have to insert
two addresses first, retrieve their id's and insert those into the user
table.  Conversely, an update introduces its own challenges as well.  If
someone could show me these pieces, I have pretty much figured out
everything else I need to do with the foreign keys, etc.  It seems doable
easily with pgpsql; however, I cannot use that for a rule, correct?

Thanks,
Brian