Re: [GENERAL] correlated delete with 'in' and 'left outer join'

2004-02-27 Thread Mike Mascari
Michael Chaney wrote: Please, before continuing this thread, read my post below. What you're all getting around to, albeit painfully, is that this subquery is worthless as-is. This is the mysql way of finding rows in one table with no match in another without the convenience of the "in" or "exis

Re: [GENERAL] field must appear in the GROUP BY clause or be used

2004-02-27 Thread Richard Huxton
On Friday 27 February 2004 16:39, Bill Moran wrote: > John Sidney-Woollett wrote: > > Bill Moran said: > >> > >>SELECT GCP.id, > >>GCP.Name > >> FROMGov_Capital_Project GCP, > >> WHERE TLM.TLI_ID = $2 > >> group by GCP.id > >> ORDER BY gcp.name; > >>ERROR: column "gcp

Re: [GENERAL] correlated delete with 'in' and 'left outer join'

2004-02-27 Thread Michael Chaney
> >The original subquery looked like: > >select distinct e.ItemID from LogEvent e left outer join Item i > >on e.ItemID = i.ItemID where e.EventType != 'i' and i.ItemID is null Please, before continuing this thread, read my post below. What you're all getting around to, albeit painfully, is that

Re: [GENERAL] field must appear in the GROUP BY clause or be used

2004-02-27 Thread scott.marlowe
On Fri, 27 Feb 2004, Bill Moran wrote: > Hey all. > > I've hit an SQL problem that I'm a bit mystified by. I have two different > questions regarding this problem: why? and how do I work around it? > > The following query: > > SELECTGCP.id, > GCP.Name > FROMGov_Capital_

Re: [GENERAL] field must appear in the GROUP BY clause or be used

2004-02-27 Thread Mike Mascari
Bill Moran wrote: Hey all. I've hit an SQL problem that I'm a bit mystified by. I have two different questions regarding this problem: why? and how do I work around it? The following query: SELECT GCP.id, GCP.Name FROMGov_Capital_Project GCP, WHERE TLM.TLI_ID = $2 group

[GENERAL] On Update (trigger hint)

2004-02-27 Thread MaRCeLO PeReiRA
Hi guys, Please, give me some advices on how to do the following: I have the following table: CREATE TABLE products ( idSERIAL, description TEXT, lastupdatedate ); Well, I would like to update the column "lastupdate" with the value "now()" on every UPDATE executed on

Re: [GENERAL] field must appear in the GROUP BY clause or be used

2004-02-27 Thread Bill Moran
John Sidney-Woollett wrote: Bill Moran said: I've hit an SQL problem that I'm a bit mystified by. I have two different questions regarding this problem: why? and how do I work around it? The following query: SELECT GCP.id, GCP.Name FROMGov_Capital_Project GCP, WHERE TLM.TLI

Re: [GENERAL] compartmentalizing users

2004-02-27 Thread Bill Moran
[EMAIL PROTECTED] wrote: Is there a way to segregate users by database or schema so that in a hosting situation you could keep different customers apart? Otherwise, the unpleasant alternative is to run separate instances of Postgres. You can add users and assign rights at the database level. -- B

Re: [GENERAL] field must appear in the GROUP BY clause or be used

2004-02-27 Thread John Sidney-Woollett
Bill Moran said: > I've hit an SQL problem that I'm a bit mystified by. I have two different > questions regarding this problem: why? and how do I work around it? > > The following query: > > SELECTGCP.id, > GCP.Name > FROMGov_Capital_Project GCP, > WHERE TLM.TLI_ID =

Re: [GENERAL] change db encoding

2004-02-27 Thread Ron St-Pierre
Alexander Cohen wrote: How would i go about changing a databases encoding? Is this at all possible? There does not seem to be much i can with ALTER DATABASE except change its name! You could try to: -pg_dump the database to file, -drop the database, -recreate the database with unicode encoding

Re: [GENERAL] correlated delete with 'in' and 'left outer join'

2004-02-27 Thread Mike Mascari
Stephan Szabo wrote: On Fri, 27 Feb 2004, Mike Mascari wrote: To do what I think you believe to be happening w.r.t. outer joins, you'd have to have a subquery like: [EMAIL PROTECTED] select a.fookey test-# FROM test-# (SELECT foo.key AS fookey, bar.key as barkey FROM foo LEFT OUTER JOIN bar ON foo

[GENERAL] field must appear in the GROUP BY clause or be used in an aggregate function?

2004-02-27 Thread Bill Moran
Hey all. I've hit an SQL problem that I'm a bit mystified by. I have two different questions regarding this problem: why? and how do I work around it? The following query: SELECT GCP.id, GCP.Name FROMGov_Capital_Project GCP, WHERE TLM.TLI_ID = $2 group by GCP.id ORD

Re: [GENERAL] Case of strings

2004-02-27 Thread Paul Thomas
On 27/02/2004 12:06 Simon Windsor wrote: Is there anyway I can force the PgSQL to accept case equivalence, or must I add upper()/lower() to force the case and then make string tests? Ie Where upper(A)=upper('String') You could use ilike where a ilike 'string' You can also use POSIX regular expr

Re: [GENERAL] correlated delete with 'in' and 'left outer join'

2004-02-27 Thread Stephan Szabo
On Fri, 27 Feb 2004, Mike Mascari wrote: > To do what I think you believe to be happening w.r.t. outer joins, > you'd have to have a subquery like: > > [EMAIL PROTECTED] select a.fookey > test-# FROM > test-# (SELECT foo.key AS fookey, bar.key as barkey FROM foo LEFT > OUTER JOIN bar ON foo.key =

Re: [GENERAL] PostgreSQL insert speed tests

2004-02-27 Thread Greg Stark
> > create index agentid_ndx on logs using hash (agentid); > > create index ownerid_ndx on logs using hash (ownerid); > > create index hostid_ndx on logs using hash (hostid); > > What about concurrent inserts (cocurrent spare test program execution) into > > the same table? It did not work. Has

Re: [GENERAL] Postgres clustering?

2004-02-27 Thread Keith Bottner
Thanks Andrew, I will do some digging on the Postgres-R front to see what their focus is. Keith -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Sullivan Sent: Thursday, February 26, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: Re: [GENERAL] Postgres

Re: [GENERAL] Case of strings

2004-02-27 Thread Michael Chaney
On Fri, Feb 27, 2004 at 12:06:58PM -, Simon Windsor wrote: > Hi > > I have moved an application from MySQL to PgSQL, and after the making > changes I thought all was ok. > > However, I have just realised that > > Where A = 'STRING' > > Is not the same as > > Where A ='String' This is sta

Re: [GENERAL] check for user validity

2004-02-27 Thread Bruno Wolff III
On Thu, Feb 26, 2004 at 22:17:14 -0500, Alexander Cohen <[EMAIL PROTECTED]> wrote: > I know in advance all the information a user to start up a connection > to postgres and do queries. I would like to be able to check and see if > that user will be able to connect with his current crudentials.

Re: [GENERAL] PostgreSQL insert speed tests

2004-02-27 Thread Sezai YILMAZ
Sezai YILMAZ wrote: create index agentid_ndx on logs using hash (agentid); create index ownerid_ndx on logs using hash (ownerid); create index hostid_ndx on logs using hash (hostid); speed for speed for

Re: [GENERAL] correlated delete with "in" and "left outer join"

2004-02-27 Thread Michael Chaney
On Thu, Feb 26, 2004 at 06:26:19PM -0800, [EMAIL PROTECTED] wrote: > I'm using postgresl 7.3.2 and have a query that executes very slowly. > > There are 2 tables: Item and LogEvent. ItemID (an int4) is the > primary key > of Item, and is also a field in LogEvent. Some ItemIDs in LogEvent do > not

Re: [GENERAL] Simple,

2004-02-27 Thread John Sidney-Woollett
Better would be to match Oracle's sqlPlus feature, DEFINE. The gist of which is that you can create a SQL statement with an "&" (or other 'defined' character) in it. If DEFINE is ON, then the interpreter prompts you for the value when it encounters the "&". After getting the value it then processe

Re: [GENERAL] PostgreSQL insert speed tests

2004-02-27 Thread Bill Moran
I don't know the answer to the question of why 7.4 is slower, but I have some suggestions on additional things to test, and how to make it faster. First off, try 200 transactions of 1000 records each, you might even want to try 20 transactions of 10,000 records each. Postgres seems to run much fas

Re: [GENERAL] Simple, but VERYuseful enhancement for psql command - or am I

2004-02-27 Thread Nick Barr
Ben wrote: I'm designing a fairly involved database system. As part fo the process, I use the \i [FILE] command a great deal. I set up fairly involved queries, sometimes simply for the purpose of shortening column names so the output is reasonable. For example: SELECT longname AS abbr,othername as

Re: [GENERAL] PostgreSQL insert speed tests

2004-02-27 Thread Shridhar Daithankar
Sezai YILMAZ wrote: Test Hardware: IBM Thinkpad R40 CPU: Pentium 4 Mobile 1993 Mhz (full powered) RAM: 512 MB OS: GNU/Linux, Fedora Core 1, kernel 2.4.24 A test program developed with libpq inserts 200.000 rows into table logs. Insertions are made with 100 row per transaction (total 2.000 transac

Re: [GENERAL] Case of strings

2004-02-27 Thread cnliou
>Is there anyway I can force the PgSQL to accept case equivalence, or must I >add upper()/lower() to force the case and then make string tests? > > > >Ie Where upper(A)=upper('String') I think you already answered your own question as pgsql document does in section "9.4. String Functions and

Re: [GENERAL] Help with a query

2004-02-27 Thread Bas Scheffers
Klint, > select groname from pg_group > where (select usesyside from pg_shadow where usename = 'postgres') = > any(grolist); Unless you are lgged in as superuser (and applications other than pgAdmin et al shouldn't be) you will get access denied on pg_shadow. (because it contains passwords) Select

[GENERAL] Case of strings

2004-02-27 Thread Simon Windsor
Hi   I have moved an application from MySQL to PgSQL, and after the making changes I thought all was ok.   However, I have just realised that   Where A = ‘STRING’   Is not the same as   Where A =’String’   Is there anyway I can force the PgSQL to accept case equivalence, or mus

Re: [GENERAL] Help with a query

2004-02-27 Thread Bas Scheffers
If the user/groups you are talking about are postgres users and groups, this is it: select * from pg_catalog.pg_group where (select usesysid from pg_catalog.pg_user where usename = 'user') = any(grolist) The place to find this kind of thing is the Postgres Internals section (system catalogs) that

Re: [GENERAL] Windows Library for libpq

2004-02-27 Thread Karam Chand
Thanks. --- Shachar Shemesh <[EMAIL PROTECTED]> wrote: > Shachar Shemesh wrote: > > > Karam Chand wrote: > > > >> Hello > >> > >> I have read the docs.you need to install > PostgrSQL > >> using cygwin etc. I am not in a position right > now to > >> do that :) > >> > >> Are no standard libpq.l

Re: [GENERAL] Windows Library for libpq

2004-02-27 Thread Shachar Shemesh
Shachar Shemesh wrote: Karam Chand wrote: Hello I have read the docs.you need to install PostgrSQL using cygwin etc. I am not in a position right now to do that :) Are no standard libpq.lib for Windows available? In MySQL you get a precompiled library for C API and that is very helpful. Can