Re: [SQL] groups in postgres

2001-04-19 Thread Richard Huxton

Martín Marqués <[EMAIL PROTECTED]> said:

> I building an application that will load data on a database by lots of 
> people. So I thought about putting them in a group and giving priviledges to 
> the group.
> 
> The problem is the the information on the main table is related with fields 
> of other tables, and depending on how it's related, I want some users to be 
> able to modify the data and I don't want those users to insert new data if 
> the relation is right for them.
> 
> Am I clear up to know?
> 
> Now, how can I do this? Is it posible manipulating groups? Or do I have to 
> play with triggers.

Sounds like you want different groups for different users, and a view for each
group. You can then define rules for each view defining the access that is
available.

Is that what you're after?

- Richard Huxton

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [SQL] any proper benchmark scripts?

2001-04-19 Thread Justin Clift

Hi Clayton,

Was it opening a new connection to the database every time, or did it
open one connection each time and pump multiple queries through it?

It would be a good things to develop your script and benchmark this both
ways.  Could become a useful tool for sizing both of these databases.

Out of curiosity do you have access to other databases such as
Interbase, Oracle, DB2, Informix, and so forth?  The more it can connect
to, the better people will be able to understand each one's strengths
and weaknesses, in terms of Perl's DB access.

Regards and best wishes,

Justin Clift

Clayton Cottingham aka drfrog wrote:
> 
> hello
> 
> on the modperl list a good thread was happening called
> 'fast db access'
> find attached scripts used to do this
> 
> here are my results:
> 
> [drfrog]$ perl fast_db.pl
> postgres
> 16 wallclock secs ( 0.05 usr +  0.00 sys =  0.05 CPU) @ 400.00/s (n=20)
> mysql
>  3 wallclock secs ( 0.07 usr +  0.00 sys =  0.07 CPU) @ 285.71/s (n=20)
> postgres
> 17 wallclock secs ( 0.06 usr +  0.00 sys =  0.06 CPU) @ 333.33/s (n=20)
> mysql
>  3 wallclock secs ( 0.01 usr +  0.01 sys =  0.02 CPU) @ 1000.00/s (n=20)
> 
> correct me if im wrong but if fast_db.pl is
> working right
> first set is insert
> second set is select
> 
> comp stats
> 
> running stock rpms from mandrake 7.2 for both
> postgresql and mysql
>  3.23.23-beta of mysql and
> 7.02 of postgresql
> 
> [drfrog@nomad desktop]$ uname -a
> Linux nomad.localdomain 2.2.18 #2 Tue Apr 17 22:55:04 PDT 2001 i686 unknown
> 
> [drfrog]$ cat /proc/meminfo
> total:used:free:  shared: buffers:  cached:
> Mem:  257511424 170409984 87101440 24219648 96067584 44507136
> Swap: 2549432320 254943232
> MemTotal:251476 kB
> MemFree:  85060 kB
> MemShared:23652 kB
> Buffers:  93816 kB
> Cached:   43464 kB
> SwapTotal:   248968 kB
> SwapFree:248968 kB
> [drfrog]$ cat /proc/cpuinfo
> processor   : 0
> vendor_id   : AuthenticAMD
> cpu family  : 6
> model   : 3
> model name  : AMD Duron(tm) Processor
> stepping: 1
> cpu MHz : 697.535
> cache size  : 64 KB
> fdiv_bug: no
> hlt_bug : no
> sep_bug : no
> f00f_bug: no
> coma_bug: no
> fpu : yes
> fpu_exception   : yes
> cpuid level : 1
> wp  : yes
> flags   : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat
> pse36 psn mmxext mmx fxsr 3dnowext 3dnow
> bogomips: 1392.64
> 
> i will recomp both the newest postgresql and  mysql
> 
> not using any optimizing techs at all i'll post the
> 
> config scripts i use
> 
> --
> back in the day
> we didn't have no
> old school
> -dr. frog
> http://www.hyperbomb.com
> it sells itself
> 
>   
>  Name: fast_db.pl
>fast_db.plType: Perl Program (application/x-perl)
>  Encoding: base64
> 
> Name: benchmark.sql
>benchmark.sqlType: application/x-unknown-content-type-sql_auto_file
> Encoding: base64
> 
>   
> 
> ---(end of broadcast)---
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
 - Indira Gandhi

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [SQL] groups in postgres

2001-04-19 Thread Martín Marqués

On Jue 19 Abr 2001 11:12, Richard Huxton wrote:
> Martín Marqués <[EMAIL PROTECTED]> said:
> > I building an application that will load data on a database by lots of
> > people. So I thought about putting them in a group and giving priviledges
> > to the group.
> >
> > The problem is the the information on the main table is related with
> > fields of other tables, and depending on how it's related, I want some
> > users to be able to modify the data and I don't want those users to
> > insert new data if the relation is right for them.
> >
> > Am I clear up to know?
> >
> > Now, how can I do this? Is it posible manipulating groups? Or do I have
> > to play with triggers.
>
> Sounds like you want different groups for different users, and a view for
> each group. You can then define rules for each view defining the access
> that is available.

They're gonna be groups of users, which will be loading data related to there 
group. I don't want the users from one group to load data related to other 
groups. And there is going to be a super-group that can change anything.

I'm not sure about the views and rules. Never used them. I'll check it out. 
;-)

Saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-
Martin Marques  |[EMAIL PROTECTED]
Programador, Administrador  |   Centro de Telematica
   Universidad Nacional
del Litoral
-

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] windows version

2001-04-19 Thread Padmajha Raghunaathan

Is there a downloadable version of postgres for Windows NT??.
Thanx in advance
padmajha



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [SQL] any proper benchmark scripts?

2001-04-19 Thread Thomas Good

On 18 Apr 2001, Clayton Cottingham aka drfrog wrote:

> i will recomp both the newest postgresql and  mysql 
> not using any optimizing techs at all i'll post the 
> config scripts i use

Hiya Clayton,

Try it with a few hundred thousand tuples in a good size table with
say 300 users banging on the box.  MySQL is a nice substitute for
Access but that's about it.

Not to mention missing features:  views and foreign keys for 
example...and have a look at the API...yuck.  I always hear people
complain (MySQL fans) about Pg not having DROP COLUMN in its SQL
implementation.  To me a VIEW is slightly more important.  ;-)

(Trying hard not to be obnoxious here but failing.  Comparing MySQL
to Pg is like comparing windows to BSD...and I just can't apologise
for calling it like I see it!)

Cheers!
Tom (the most obnoxious man in Staten Island?)


   SVCMC - Center for Behavioral Health  

Thomas Good  tomg@ { admin | q8 } .nrnet.org
Database Administrator  Phone:  718-354-5528 
Staten Island RegionMobile: 917-282-7359  

Powered by:  PostgreSQL s l a c k w a r e  FreeBSD:
   RDBMS   |-- linux  The Power To Serve


 /* We prefer linguistic vigor over mathematical rigor. */ 


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] Postgres book

2001-04-19 Thread Mateusz Mazur

Hello.

I wonder if anyone have
PostgreSQL: Introduction and Concepts by Bruce Momjian 
in pdf version.

I will be very greatfull for any news.

Mateusz Mazur
[[EMAIL PROTECTED]]

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[SQL] copy into serial field with auto_increment

2001-04-19 Thread Andy

Hello,

i've got a textfile of data separated by '|'. One of the fields in my
table is a serial (auto_increment) field.
When i import the data with the copy command i get duplicate key error.
The key is the serial - field.
I recognized that the copy command doesn't auto_increment the serial
field. I come from mysql and pushed a 0 into the serial field. But it
doesn't work. I tested it with an empty field, but it failed to.
How could i make it work ??

Thanx for every help

--
Andy - Kim Möller
Leiter Lastminute / Pauschal - Deutschland ypsilon.net AG
Leiter Entwicklungsabteilung Lastminute / Pauschal / Mietwagen -
Deutschland ypsilon.net AG

Tel.: (06109) - 50 50
FAX : (06109) - 50 525
eMail : [EMAIL PROTECTED]



begin:vcard 
n:Möller;Andy-Kim
tel;cell:0179/2302856
tel;fax:06109 / 505 25 
tel;home:06661/4526
tel;work:06109 / 505 193
x-mozilla-html:FALSE
url:http://www.ypsilon.net
org:i. A. d. F. Ypsilon - Network GmbH;Database - Managment & Software - Development
adr:;;Vilbeler Landstr. 203;Frankfurt;Hessen;60388;Germany
version:2.1
email;internet:[EMAIL PROTECTED]
fn:Andy-Kim Möller
end:vcard



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] Re: [GENERAL] Where are the 7.1 RPM's?

2001-04-19 Thread Lamar Owen

Lonnie Cumberland wrote:
> Do anyone know where the 7.1 RPM's are so that I can install them?

ftp://ftp.postgresql.org/pub/binary/v7.1/RPMS.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] Postgresql to Access

2001-04-19 Thread Mateusz Mazur

Hello.

Could you help me? I have database in psql and my boss want to have this
base also is MS Access (only like client - main base will be psql). He wants
to use access like viewer to psql base. What should I do.

Big Thanx for any sugestion.

Mateusz Mazur

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [SQL] any proper benchmark scripts?

2001-04-19 Thread clayton cottingham

Justin Clift wrote:
> 
> Hi Clayton,
> 
> Was it opening a new connection to the database every time, or did it
> open one connection each time and pump multiple queries through it?
> 
> It would be a good things to develop your script and benchmark this both
> ways.  Could become a useful tool for sizing both of these databases.
> 
> Out of curiosity do you have access to other databases such as
> Interbase, Oracle, DB2, Informix, and so forth?  The more it can connect
> to, the better people will be able to understand each one's strengths
> and weaknesses, in terms of Perl's DB access.
> 
> Regards and best wishes,
> 
> Justin Clift
>

ok i looked over the script and the connections are opened before for
loops and shuit down after for loops

i dont have access to any other db's

but another person on the modperl list said he would be try oracle


check out that thread its been going since monday?
perl.apache.org click through maillists and use mailarchive.com
search for 'fast db access'
thats the thread!!

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [SQL] any proper benchmark scripts?

2001-04-19 Thread clayton cottingham

Thomas Good wrote:
> 
> On 18 Apr 2001, Clayton Cottingham aka drfrog wrote:
> 
> > i will recomp both the newest postgresql and  mysql
> > not using any optimizing techs at all i'll post the
> > config scripts i use
> 
> Hiya Clayton,
> 
> Try it with a few hundred thousand tuples in a good size table with
> say 300 users banging on the box.  MySQL is a nice substitute for
> Access but that's about it.
> 


if you check the script youll see its fairly cool how they set it up



> Not to mention missing features:  views and foreign keys for
> example...and have a look at the API...yuck.  I always hear people
> complain (MySQL fans) about Pg not having DROP COLUMN in its SQL
> implementation.  To me a VIEW is slightly more important.  ;-)
> 


yes all that was tested was inserts and selects

check my prev post if you check out that thread on modperl
youlll see why these where not included

they were testing hashes versus Storable.pm versus postgres versus
flatfile


> (Trying hard not to be obnoxious here but failing.  Comparing MySQL
> to Pg is like comparing windows to BSD...and I just can't apologise
> for calling it like I see it!)



i agree


> 
> Cheers!
> Tom (the most obnoxious man in Staten Island?)
>

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [SQL] Postgresql to Access

2001-04-19 Thread Roberto Mello

On Thu, Apr 19, 2001 at 03:43:30PM +0200, Mateusz Mazur wrote:
> Hello.
> 
> Could you help me? I have database in psql and my boss want to have this
> base also is MS Access (only like client - main base will be psql). He wants
> to use access like viewer to psql base. What should I do.

Look at the article an http://techdocs.postgresql.org

-Roberto
-- 
+| http://fslc.usu.edu USU Free Software & GNU/Linux Club |--+
  Roberto Mello - Computer Science, USU - http://www.brasileiro.net 
   http://www.sdl.usu.edu - Space Dynamics Lab, Developer
I know a good tagline when I steal one.

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] Re: Postgresql to Access

2001-04-19 Thread Joel Burton

On Thu, 19 Apr 2001, Mateusz Mazur wrote:

> Hello.
> 
> Could you help me? I have database in psql and my boss want to have this
> base also is MS Access (only like client - main base will be psql). He wants
> to use access like viewer to psql base. What should I do.

You can create a front-end using linked tables. Any good Access book will
walk through the basics of linked tables.

PostgreSQL-specific stuff is in a FAQ at www.scw.org/pgaccess


-- 
Joel Burton   <[EMAIL PROTECTED]>
Director of Information Systems, Support Center of Washington


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [SQL] function to format floats as money? (removing space padding)

2001-04-19 Thread Mark Stosberg


Now that I've figured out that numeric is good for storing money, and
that I can format with like this:

to_char(price, '9,999,999.99') as price

Then I discovered that sometimes this returns leading spaces I don't
want. I can get rid of them like this:

trim(to_char(price, '9,999,999.99')) as price

Is that the recommended money formatting style, for amounts less than
9,999,999.99? (assuming I'll tack on my own currency symbol? ). Other
there other general styles that folks like for this? Thanks,

  -mark

personal website }  Summersault Website Development
http://mark.stosberg.com/{  http://www.summersault.com/

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [SQL] copy into serial field with auto_increment

2001-04-19 Thread Oliver Elphick

Andy wrote:
  >i've got a textfile of data separated by '|'. One of the fields in my
  >table is a serial (auto_increment) field.
  >When i import the data with the copy command i get duplicate key error.
  >The key is the serial - field.
  >I recognized that the copy command doesn't auto_increment the serial
  >field. I come from mysql and pushed a 0 into the serial field. But it
  >doesn't work. I tested it with an empty field, but it failed to.
  >How could i make it work ??
 
It's not clear to me whether your error is during COPY or afterwards.

If it is during COPY, edit your textfile and assign unique values to
each row.


If it is afterwards, use 

  SELECT setval('sequence_name', SELECT max(serial_field) FROM table);

to set the sequence value.  (You probably have to be running 7.1 to use
a sub-select like that.)


-- 
Oliver Elphick[EMAIL PROTECTED]
Isle of Wight  http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
 
 "For I am persuaded, that neither death, nor life, nor 
  angels, nor principalities, nor powers, nor things 
  present, nor things to come, nor height, nor depth, 
  nor any other creature, shall be able to separate us 
  from the love of God, which is in Christ Jesus our 
  Lord." Romans 8:38,39 



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [SQL] any proper benchmark scripts?

2001-04-19 Thread Roberto Mello

On Wed, Apr 18, 2001 at 07:00:24PM -0700, Clayton Cottingham aka drfrog wrote:

"Benchmarks" comparing MySQL to anything else usually make the worst
and lowest denominator compromise (which obviously favours MySQL).

- What table types did you use on MySQL? Did you use the BDB (or
  whatever the transaction tables are called) or ISAM tables? If you
  didn't use transactional tables, it's not a fair comparison.

- In PostgreSQL, did you do the inserts in a single transaction block
  or just did what MySQL users usually do because they know what a
  transaction is, and left every INSERT on its own (effectively
  putting each on its transaction block)?

  If you didn't put the inserts into a single transaction block, then
  it's not a realistic test because that's not what you would do in
  real life in a real database system (pretty much anything besides
  MySQL and Access).
> 
> correct me if im wrong but if fast_db.pl is 
> working right 
> first set is insert
> second set is select

Speed is good. But it's not everything. You should do it right, then
make it fast. MySQL implementors don't care about doing it right. They
just care about making it fast.
My filesystem is much faster than the MySQL filesystem (that's what it
is). UDP is faster than TCP, but TCP is better and more reliable. A
skydiver without a parachute will always fall faster than the one with
parachute. The skydiving school will say "we make your fall more exciting,
and much faster than our competitors." and the dumb skydivers will reply 
"well, if you make my fall faster, then of course you're the best". 
Which one will survive the fall?

Comparing MySQL to PostgreSQL, Oracle or any other real database is
like comparing DOS with UNIX, or Emacs with an orange. 

-Roberto Mello
-- 
+| http://fslc.usu.edu USU Free Software & GNU/Linux Club |--+
  Roberto Mello - Computer Science, USU - http://www.brasileiro.net 
   http://www.sdl.usu.edu - Space Dynamics Lab, Developer
I wonder what this button does? *&^(&^)#@$*&_% NO CARRIER

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [SQL] Postgresql to Access

2001-04-19 Thread Poul L. Christiansen

On the MS Access box you can install the PostgreSQL Windows ODBC drivers
that connect to the psql base.

In Access you can link to the PostgreSQL ODBC and the you have a link to
PostgreSQL from Access. You can the use the link (almost) like an
ordinary MS Access table.

Windows  ODBC drivers are available from www.greatbridge.org

HTH,
Poul L. Christiansen

Mateusz Mazur wrote:
> 
> Hello.
> 
> Could you help me? I have database in psql and my boss want to have this
> base also is MS Access (only like client - main base will be psql). He wants
> to use access like viewer to psql base. What should I do.
> 
> Big Thanx for any sugestion.
> 
> Mateusz Mazur
> 
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]