Re: [GENERAL] Optimising SQL Queries?

2004-01-13 Thread Martijn van Oosterhout
Hmm, relational algebra is not always straight, and anyway, many people complain that SQL doesn't really conform to relational algebra anyway. The usual things to check are (off the top of my head): * Are you using UNION where UNION ALL would be more appropriate (saves a unique) * Are the subse

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread Shridhar Daithankar
On Tuesday 13 January 2004 22:13, Keith G. Murphy wrote: > John Sidney-Woollett wrote: > > What you could consider is one or more pools which map to the "roles" > > that your (web) app supports. For example, if a user needs "minimal > > rights" access to db resources, then your cgi (request handler

Re: [GENERAL] serverless postgresql

2004-01-13 Thread Jeff Bowden
Tom Lane wrote: Jeff Bowden <[EMAIL PROTECTED]> writes: What about the notion of running postmaster on-demand as the user? Possibly. You'd have to think carefully about what conditions the postmaster should be shut down under, and especially what conditions it should NOT be shut down unde

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread Alex Satrapa
Keith Murphy wrote: At some point, I may try rolling my own PAM module (as Tom Lane suggested) that uses the user's browser-authenticated username and password to map to a PostgreSQL username that constitutes a "role" (assuming that's possible). One option is to add an extra layer of indirection

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread Keith Murphy
scott.marlowe wrote: On Tue, 13 Jan 2004, Keith G. Murphy wrote: I'm trying to get a feel for what most people are doing or consider best practice. Given a mod_perl application talking to a PostgreSQL database on the same host, where different users are logging onto the web server using LDAP

Re: [GENERAL] sql insert function

2004-01-13 Thread Richard Huxton
On Tuesday 13 January 2004 17:46, Chris Ochs wrote: > Yes it was in my function. I thought the docs said that BEGIN and END had > no effect on transactions though? Plus wouldn't there have to be a > transaction active since I was not using autocommit and the inserts did in > fact commit? > > I su

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread Keith G. Murphy
Tom Lane wrote: "Keith G. Murphy" <[EMAIL PROTECTED]> writes: Hmmm, mightn't it be kind of nice if there were PAM or krb5 maps in addition to ident maps? ISTM the whole point of PAM is that you plug in your desired security policy outside of the application. You shouldn't be asking for more s

Re: [GENERAL] Nested transaction - I am a bank ??

2004-01-13 Thread Richard Huxton
On Tuesday 13 January 2004 17:47, Thapliyal, Deepak wrote: > Hi, > > Assume I have a bank app.. When customer withdraws $10 from his accouint I > have to do following > --> update account_summary table [subtract $10 from his account] > --> update account detail_table [with other transac

Re: [GENERAL] Pl/Perl speed

2004-01-13 Thread Tom Lane
"Chris Ochs" <[EMAIL PROTECTED]> writes: > I am pretty sure I know this already, but every time you run a Pl/Perl > function it is just like running a perl script as far as having to load and > compile the code right? No, the perl script gets compiled only the first time the function is invoked (w

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread Tom Lane
"Keith G. Murphy" <[EMAIL PROTECTED]> writes: > Hmmm, mightn't it be kind of nice if there were PAM or krb5 maps in > addition to ident maps? ISTM the whole point of PAM is that you plug in your desired security policy outside of the application. You shouldn't be asking for more security frammis

[GENERAL] Pl/Perl speed

2004-01-13 Thread Chris Ochs
I am pretty sure I know this already, but every time you run a Pl/Perl function it is just like running a perl script as far as having to load and compile the code right? My application runs under mod perl so I'm thinking that speed is not something I would gain by putting any of the code into the

[GENERAL] Nested transaction - I am a bank ??

2004-01-13 Thread Thapliyal, Deepak
Can I use a "set transaction" type mechanism within a function? thx Deep -Original Message- From: Joshua D. Drake [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 13, 2004 10:17 AM To: Thapliyal, Deepak Cc: 'Richard Huxton'; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [GENERAL] Ne

Re: [GENERAL] Nested transaction - I am a bank ??

2004-01-13 Thread Joshua D. Drake
Thapliyal, Deepak wrote: Hi, Assume I have a bank app.. When customer withdraws $10 from his accouint I have to do following --> update account_summary table [subtract $10 from his account] --> update account detail_table [with other transaction details] Requirement: either both transaction

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread scott.marlowe
On Tue, 13 Jan 2004, Keith G. Murphy wrote: > I'm trying to get a feel for what most people are doing or consider best > practice. > > Given a mod_perl application talking to a PostgreSQL database on the > same host, where different users are logging onto the web server using > LDAP for authen

Re: [GENERAL] Postgress and MYSQL

2004-01-13 Thread Joshua D. Drake
(I do wonder how quickly they are running through that $19 mil investment though ...) Let's see if they can beat GB? *evil grin* I seriously doubt they will be a GB... MySQL is at least making money (probably not profit though). They have a huge, loyal following and presumably a decent s

Re: [GENERAL] Any real known bugs about wrong selects?

2004-01-13 Thread scott.marlowe
On Tue, 13 Jan 2004, Joshua D. Drake wrote: > > > The real question was: are there open known bugs where a select > > statement does not return a correct result, meaning a wrong number of > > rows? Were there a lot of errors like this? > > We are asking this because this makes trouble with the

[GENERAL] Nested transaction - I am a bank ??

2004-01-13 Thread Thapliyal, Deepak
Hi, Assume I have a bank app.. When customer withdraws $10 from his accouint I have to do following --> update account_summary table [subtract $10 from his account] --> update account detail_table [with other transaction details] Requirement: either both transactions sho

Re: [GENERAL] sql insert function

2004-01-13 Thread Chris Ochs
Yes it was in my function. I thought the docs said that BEGIN and END had no effect on transactions though? Plus wouldn't there have to be a transaction active since I was not using autocommit and the inserts did in fact commit? I suspect it is the end statement doing this though, I'll take it o

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread John Sidney-Woollett
Keith G. Murphy said: > Perhaps I can answer my own question. I could use ident and a map that > lists the web server username as able to map to the different "role" > usernames. Someone else also mentioned and I personally agree that it's better to authenticate in the application layer (using wh

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread Keith G. Murphy
John Sidney-Woollett wrote: Keith G. Murphy said: That sounds like an excellent compromise. How do you typically handle the mechanics of authentication from web server to PostgreSQL on the connect, using this scheme? Sorry but I can't help you out here, I'm too much of a newbie with Postgres -

Re: [GENERAL] Reallife szenario for GEQO

2004-01-13 Thread Bernd Helmle
Tom Lane wrote: Bernd Helmle <[EMAIL PROTECTED]> writes: But what means "enough tables"? GEQO_THRESHOLD or more. You can set that anywhere you like (I think the default is 11 or 12, which is about where the standard exhaustive-search planner becomes painfully slow). regards, tom lane Thank

Re: [GENERAL] Postgress and MYSQL

2004-01-13 Thread Marc G. Fournier
On Tue, 13 Jan 2004, Tom Lane wrote: > "Bob Powell" <[EMAIL PROTECTED]> writes: > > I find the recent articles in various trade publications a little > > disturbing due to the lack of PostgrSQL mention. > > You are seeing the effects of MySQL AB's large marketing budget; > they have the time and m

Re: [GENERAL] Postgress and MYSQL

2004-01-13 Thread Randal L. Schwartz
> "Tom" == Tom Lane <[EMAIL PROTECTED]> writes: Tom> "Bob Powell" <[EMAIL PROTECTED]> writes: >> I find the recent articles in various trade publications a little >> disturbing due to the lack of PostgrSQL mention. Tom> You are seeing the effects of MySQL AB's large marketing budget; Tom> the

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread John Sidney-Woollett
Keith G. Murphy said: > That sounds like an excellent compromise. How do you typically handle > the mechanics of authentication from web server to PostgreSQL on the > connect, using this scheme? Sorry but I can't help you out here, I'm too much of a newbie with Postgres - I was hoping that someon

Re: [GENERAL] Postgress and MYSQL

2004-01-13 Thread Tom Lane
"Bob Powell" <[EMAIL PROTECTED]> writes: > I find the recent articles in various trade publications a little > disturbing due to the lack of PostgrSQL mention. You are seeing the effects of MySQL AB's large marketing budget; they have the time and money to cause such articles to appear. I'm not su

Re: [GENERAL] Any real known bugs about wrong selects?

2004-01-13 Thread Stephan Szabo
On Tue, 13 Jan 2004, David Teran wrote: > I wonder if people encountered bugs like 'a select returns a wrong > number of rows' or any other very serious bugs. We do not have problems It's happened on rare occasion in the past in my recollection for things that are basically bugs. It generally get

Re: [GENERAL] Postgress and MYSQL

2004-01-13 Thread John Sidney-Woollett
Bob Powell said: > I continue to see articles about how IBM may be considering MYSQL for > development an open_source web database. Why would IBM use and promote postgres when it is much closer an offering to DB2 than MySQL, and a much bigger commercial threat? I'll bet that IBM will be planning

Re: [GENERAL] Best practice? Web application: single PostgreSQL

2004-01-13 Thread Keith G. Murphy
John Sidney-Woollett wrote: Keith G. Murphy said: 2) have the web server connecting to the database actually using the user's account (possibly using LDAP authentication against PostgreSQL), and controlling access to different database entities through GRANT, etc. My experience with java web/ap

[GENERAL] Reallife szenario for GEQO

2004-01-13 Thread Bernd Helmle
I am currently searching some resources, why and where the PostgreSQL GEQO-Engine improves large join queries. The theoretical background is clear, but i need some real life szenarios, where the GEQO-Engine beats other solutions. Have anyone made such a comparison, or have experiences which sze

Re: [GENERAL] Drawbacks of using BYTEA for PK?

2004-01-13 Thread David Garamond
Alex Satrapa wrote: As long as you don't use RFC1918 addresses, the IPv4 address(es) of the host should be unique for the Internet. Append/prepend a 32 bit timestamp and you have a 64bit unique identifier that is "universally" unique (to one second). Remember that /sbin/ifconfig output usually i

Re: [GENERAL] Drawbacks of using BYTEA for PK?

2004-01-13 Thread John Sidney-Woollett
Careful... If two (or more) clients (in the same network) are going through a firewall that performs NAT, then they could appear to have the same IP address if the NAT address pool is small (single address). Appending a sequence would help resolve that issue though. John Sidney-Woollett Chris T

[GENERAL] cryptography, was Drawbacks of using BYTEA for PK?

2004-01-13 Thread Chris Travers
From: "Keith C. Perry" <[EMAIL PROTECTED]> > Using an MD5 hash to > "hide" them will slow your app down by some delta and not protect your > connection. Granted garbling that id with a password is somewhat more secure > but your connection could still be attacked or even hijacked. > > In the URL's

Re: [GENERAL] Drawbacks of using BYTEA for PK?

2004-01-13 Thread Chris Travers
Sounds to me you have concerns more along the lines of counterintelligence. > Maybe a better example of my problem is with records throughout the system > like invoices, customer data, etc... If any of these items use a sequence > and that sequence is global to the table in the database and the n

Re: [GENERAL] Any way to SELECT a list of table names?

2004-01-13 Thread Chris Travers
From: "Ken Godee" <[EMAIL PROTECTED]> > Not sure if this is what you're trying to do but... > > "SELECT tablename FROM pg_tables where tablename not like 'pg_%'" > > Will get a list of tables in the db you're connected to. > You can do that, but if by any chance, the pg_catalog schema changes,

Re: [GENERAL] Drawbacks of using BYTEA for PK?

2004-01-13 Thread Chris Travers
Answers inline. - Original Message - From: "Greg Stark" <[EMAIL PROTECTED]> > On the one hand if your GUIDs are just an MD5 of a sequence then they're just > as guessable as the sequence. The attacker can try MD5 of various numbers > until he finds the one he is (it's probably on the web

Re: [GENERAL] what we need to use postgresql in the enterprise

2004-01-13 Thread Chris Travers
I am a little confused here. I agree that there are points mentioned here that need work, but correct me if I am wrong > On Friday 09 January 2004 14:48, [EMAIL PROTECTED] wrote: > > 1. Need commit roll back in pl/pgsql much like Oracle does > > 2. Need exception handling in pl/pgsql must l

Re: [GENERAL] Drawbacks of using BYTEA for PK?

2004-01-13 Thread Chris Travers
- Original Message - From: "Alex Satrapa" <[EMAIL PROTECTED]> > As long as you don't use RFC1918 addresses, the IPv4 address(es) of the > host should be unique for the Internet. Append/prepend a 32 bit > timestamp and you have a 64bit unique identifier that is "universally" > unique (to on

Re: [GENERAL] Hierarchical queries

2004-01-13 Thread Anton . Nikiforov
Hello Everybody! Now i did what i was requesting :) One night with a computer :)) Many-many thanks to all of you :) Below is script to create tables and function to get a path through a tree. It is not a beautiful thing, but it is working :) Maybe you could give me some optimization hints? :) And m