Re: [SQL] any proper benchmark scripts?

2001-04-18 Thread Clayton Cottingham aka drfrog
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 =

Re: [SQL] Timezone conversion

2001-04-18 Thread Grant
Convert it to timestamp and minus TIMEZONE * 3600... On Wed, 11 Apr 2001, Roberto Mello wrote: > Hi, > > How can I do timezone conversions in PG? I looked on the docs and > couldn't find how. I want to find the current time in another timezone. > > Thanks, > > -Roberto

RE: [SQL] Re: DB porting questions...

2001-04-18 Thread Michael Fork
On Wed, 18 Apr 2001, Diehl, Jeffrey wrote: > Querying the entire database is difficult, and very important to me. > I tried to setup a "view of a union" scheme. That isn't supported. > Right now I am using a perl function to rewrite my sql in such a way > that it queries any of the tables I

[SQL] groups in postgres

2001-04-18 Thread Martín Marqués
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

Re: [SQL] breakage in schema with foreign keys between 7.0.3 and 7.1

2001-04-18 Thread Stef Telford
Stephan Szabo wrote: > Hmm, don't know why it's not in changelog, but the spec requires that > the target fields of a foreign key constraint are themselves constrained > by a unique or primary key constraint. maybe its time for me to go and re-read the changelog with a fine tooth comb (it has be

Re: [SQL] breakage in schema with foreign keys between 7.0.3 and7.1

2001-04-18 Thread Stephan Szabo
On Wed, 18 Apr 2001, Stef Telford wrote: > CREATE TABLE action > ( > ORDER_IDintegerPRIMARY KEY, > ORDERTYPE integerNOT NULL, > client_idchar(16)NOT NULL, > priority integerDEFAULT 5

Re: [SQL] RTREE on pointsy

2001-04-18 Thread Bruce Momjian
I believe Marc install the GIST code into the tree long ago. > Jeff Hoffmann <[EMAIL PROTECTED]> writes: > > I know there are a couple of GiST examples in contrib (seg, cube & > > intarray), but i thought there used to be at least a gist_box_ops. > > I don't recall any such thing having been re

Re: [SQL] RTREE on points

2001-04-18 Thread Oleg Bartunov
Jeff, I checked the archive and it works with 7.1 release we've implemented only several functions for box, so you may use them as example for remaining types. Regards, Oleg On Wed, 18 Apr 2001, Oleg Bartunov wrote: > On Tue, 17 Apr 2001, Jeff Hoffmann wrote: > > > Oleg

[SQL] breakage in schema with foreign keys between 7.0.3 and 7.1

2001-04-18 Thread Stef Telford
Hello everyone me again (apologies in advance :). I have been running a database under 7.0.3 for some months now, and it was all fine. The tables all loaded and it was working flawlessly. Then 7.1 came out and I noticed it had outer joins (which are a big win in one of the main views i

Re: [SQL] Subqueries in select clause

2001-04-18 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > Until you can upgrade, though, try this approach: > CREATE VIEW c_aggregate AS > SELECT sum(a) as sum_a, b FROM c GROUP BY b; > SELECT max(sum_a) FROM c_aggregate; Unfortunately that won't work in 7.0 --- grouped views have a lot of problems in that v

Re: [SQL] maybe Offtopic : PostgreSQL & PHP ?

2001-04-18 Thread Mathijs Brands
On Wed, Apr 18, 2001 at 08:54:24AM -0600, Roberto Mello allegedly wrote: > Ah, I see the problem. When you mentioned there were problems I > thought you were talking about the connections themselves. > I am using PHP 4 under AOLserver/OpenNSD, which has been fully > threaded from scra

Re: [SQL] Subqueries in select clause

2001-04-18 Thread Josh Berkus
Sara, Hey! Great to see that Postgres has made it to Israel. What's the most popular Linux distribution there? I think you have your answer ... an upgrade. RPMs for most major distributions of Linux should be available within the week. Until you can upgrade, though, try this approach: CREA

Re: [SQL] maybe Offtopic : PostgreSQL & PHP ?

2001-04-18 Thread Josh Berkus
Folks, Not to be a list-nazi or anything, but can we move this discussion to the PHP list? These issues are already part of the PHP list archives. If anyone is interested in Postgres-PHP topics, the PHP list is still quite low-traffic. -Josh Berkus ---(end of broadcast

Re: [SQL] maybe Offtopic : PostgreSQL & PHP ?

2001-04-18 Thread Roberto Mello
On Wed, Apr 18, 2001 at 04:44:36PM +0200, Mathijs Brands wrote: > I've written several applications with Apache/PHP. At first I was using > persistant connections, but I was soon forced to revert to normal db > connects. The problem is the number of connections opened. If you have > 50 Apache pr

Re: [SQL] Subqueries in select clause

2001-04-18 Thread Richard Huxton
Sara Cohen <[EMAIL PROTECTED]> said: > Hi, > > I am attempting to use subqueries in the select clause of a query > and am encountering difficulties. > > The Problem: > > > I would like to use a subquery that returns one column, but more than one > tuple. The result of this subquer

Re: [SQL] Subqueries in select clause

2001-04-18 Thread Stephan Szabo
On Wed, 18 Apr 2001, Sara Cohen wrote: > The Problem: > > > I would like to use a subquery that returns one column, but more than one > tuple. The result of this subquery is then used in an aggregate function. > > For example, suppose I have a table c, with columns a and b of > num

Re: [SQL] Subqueries in select clause

2001-04-18 Thread Tom Lane
Sara Cohen <[EMAIL PROTECTED]> writes: > Using Oracle, I could get by this problem with: > select max(d) from ((select count(b) as d from c group by a)); > However, my version of postgres doesn't support subqueries in the from > clause. Time to update to 7.1... rega

Re: [SQL] maybe Offtopic : PostgreSQL & PHP ?

2001-04-18 Thread Roberto Mello
On Wed, Apr 18, 2001 at 10:35:09PM +1000, Keith Wong wrote: > an existing connection that is no longer being used (persistent connections > do tend to have a lot of quirks tho) What quirks? I am developing a PHP now and using persistant connections. Coming from the AOLserver/OpenNSD wor

Re: [SQL] maybe Offtopic : PostgreSQL & PHP ?

2001-04-18 Thread Keith Wong
Not quite sure how your code is organised... but you could access the variable $conn by including "connect.php" into the "query.php" script. Otherwise, you will need to use persistent connections... which can be achieved via pg_pconnect... a persistent connection will instead of creating a new d

[SQL] Subqueries in select clause

2001-04-18 Thread Sara Cohen
Hi, I am attempting to use subqueries in the select clause of a query and am encountering difficulties. The Problem: I would like to use a subquery that returns one column, but more than one tuple. The result of this subquery is then used in an aggregate function. For example, sup

[SQL] maybe Offtopic : PostgreSQL & PHP ?

2001-04-18 Thread Picard, Cyril
Hi all, sorry for the maybe offtopic questions, but I did not get any answer from the PHP ML. I would like to query a postgresql db with the php language. Today I wrote a script (connectandquery.php) performing the following : - connect to the DB : $conn = pg_Connect("dbname = foo"); - execute t

Re: [SQL] Concatenate fields

2001-04-18 Thread Amanda Riera
I've tried it and it works well, thanks a lot Oliver. Amanda Oliver Elphick wrote: > Amanda Riera wrote: > >I would like concatenate some fields to have all information in just > >one field. I'm doing this below: > > > >CREATE TABLE bill_2col AS > >SELECT bill.bill_id, > >