Re: [SQL] SET AUTOCOMMIT TO OFF

2004-12-01 Thread sad
On Wednesday 01 December 2004 18:42, Tom Lane wrote: > Christoph Haller <[EMAIL PROTECTED]> writes: > > Please, could someone point me to the right list > > or tell me how to do a "SET AUTOCOMMIT TO OFF" within libpq. > > libpq does not have any support for that. Does this mean libpq calls always

Re: [SQL] Query is slower

2004-12-01 Thread Michael Fuhr
On Wed, Dec 01, 2004 at 05:26:59PM -0200, Sandro Joel Eller wrote: > I have a query using "like" operator (select * from name like 'JOHN%'), > but the table has about 500 hundred records. The has a index (create > index ixcontract_name on contract (name)) , but it is very slow because > it is

Re: [SQL] invalid 'having' clause

2004-12-01 Thread Tom Lane
"Iain" <[EMAIL PROTECTED]> writes: > Just a quick question out of curiosity, I was just wondering if this is > supposed to be valid sql: > select count(*) as cnt > from sometable > group by somecolumn > having cnt > 1 No. The HAVING clause logically executes before the SELECT output list does,

Re: [SQL] Found Large Files.. what objects are they?

2004-12-01 Thread Tom Lane
"Yudie" <[EMAIL PROTECTED]> writes: > Anyone know what it could be & how to delete the object related? How to = > find a table by oid? Look at pg_class.relfilenode, not OID. Or try contrib/oid2name. regards, tom lane ---(end of broadcast)-

Re: [SQL] grouping a many to many relation set

2004-12-01 Thread Michael Fuhr
On Wed, Dec 01, 2004 at 06:57:54AM +0100, Johan Henselmans wrote: > Richard Huxton wrote: > > > I think what's missing here is the explicit statement of which group > > these belong in. Without a value to sort/group by, there's nothing for > > your queries to "get a grip on". > > > > So - add a "

[SQL] invalid 'having' clause

2004-12-01 Thread Iain
Hi, (B (BJust a quick question out of curiosity, I was just wondering if this is (Bsupposed to be valid sql: (B (Bselect count(*) as cnt (Bfrom sometable (Bgroup by somecolumn (Bhaving cnt > 1 (B (BThis isn't valid in pg (7.4.6), but this is: (B (Bselect count(*) (Bfrom sometable (Bg

Re: [SQL] Found Large Files.. what objects are they?

2004-12-01 Thread Michael Fuhr
On Wed, Dec 01, 2004 at 12:07:20PM -0600, Yudie wrote: > I found bunch of large files (more than 1 gb) in one of database directory. > The files looks like this: > 69233123 > 69233123.1 > 69233123.2 > 69233123.3 > 69233123.4 > ...and so on. > > These large files very delay the dumping process. >

Re: [SQL] find the "missing" rows

2004-12-01 Thread Tom Lane
"Kevin B." <[EMAIL PROTECTED]> writes: > Select a.i, b.i > from t as a > left join t as b on a.i = b.i > where a.n = 'a' and b.n = 'b' and b.i is null This can't succeed since the b.n = 'b' condition is guaranteed to fail when b.* is nulled out ... regards, tom lane -

Re: [SQL] grouping a many to many relation set

2004-12-01 Thread Johan Henselmans
Richard Huxton wrote: Johan Henselmans wrote: Hi, I am having a problem grouping a many to many relationship with payments and receipts, where a payment can be for multiple receipts, and a receipt can have multiple payments. I got a list of records that are involved in such relations, but now I

[SQL] find the "missing" rows

2004-12-01 Thread Kevin B.
I would like to find the "missing" rows between two sets without using a subselect (or views). This query finds the rows that are in t1 but not in t2. (see the script below for table definitions.) QUERY 1: select * from t1 left join t2 on t1.i = t2.i where t2.i is null The above query i

[SQL] order by problem

2004-12-01 Thread Simon Moses
dear sir, when i run a query with order by customer_name i am getting the following result(ex.). AA A B AC i want it to be A B AA AB how to achieve this. thanks in advance. -Simon Moses. = ** Visit My Home Page http://www.geocities.com/ks_moses updated: 28 Sep 2004

Re: [SQL] inserting values into types

2004-12-01 Thread Karsten Hilbert
> CREATE TYPE qwerty_UDT AS (abc INT); > > CREATE TABLE t (col1 qwerty_UDT); > > INSERT INTO t (col1) VALUES (qwerty_UDT(123)); > > ERROR: function qwerty_udt(integer) does not exist > HINT: No function matches the given name and argument types. You may need to > add explicit type casts. Well

Re: [SQL] Found Large Files.. what objects are they?

2004-12-01 Thread Christopher Browne
Centuries ago, Nostradamus foresaw when [EMAIL PROTECTED] ("Yudie") would write: > I found bunch of large files (more than 1 gb) in one of database directory. > > The files looks like this: > > > 69233123 > > 69233123.1 > > > 69233123.2 > > 69233123.3 > > 69233123.4 > > ...and so on. > > These larg

Re: [SQL] Query is slower

2004-12-01 Thread Stephan Szabo
On Wed, 1 Dec 2004, Sandro Joel Eller wrote: > I have a query using "like" operator (select * from name like 'JOHN%'), > but the table has about 500 hundred records. The has a index (create > index ixcontract_name on contract (name)) , but it is very slow because > it is not using index. How do

Re: [SQL] inserting values into types

2004-12-01 Thread Tom Lane
"Andrew Thorley" <[EMAIL PROTECTED]> writes: > CREATE TYPE qwerty_UDT AS (abc INT); > CREATE TABLE t (col1 qwerty_UDT); > INSERT INTO t (col1) VALUES (qwerty_UDT(123)); > ERROR: function qwerty_udt(integer) does not exist Just say INSERT INTO t (col1) VALUES (ROW(123)); Note this will not work

Re: [SQL] inserting values into types

2004-12-01 Thread Andrew Thorley
hi mike, sorry for confusion, the test_x is my mistake, its from another type i created which is executing the same code. my error i get from: CREATE TYPE qwerty_UDT AS (abc INT); CREATE TABLE t (col1 qwerty_UDT); INSERT INTO t (col1) VALUES (qwerty_UDT(123)); is: ERROR: function qwerty_u

[SQL] Query is slower

2004-12-01 Thread Sandro Joel Eller
Hi I have a query using "like" operator (select * from name like 'JOHN%'), but the table has about 500 hundred records. The has a index (create index ixcontract_name on contract (name)) , but it is very slow because it is not using index. How do I do the query to use index? Sandro -- *Sandro

[SQL] Found Large Files.. what objects are they?

2004-12-01 Thread Yudie
I found bunch of large files (more than 1 gb) in one of database directory. The files looks like this: 69233123 69233123.1 69233123.2 69233123.3 69233123.4 ...and so on.   These large files very delay the dumping process. Anyone know what it could be & how to delete the object related? Ho

Re: [SQL] inserting values into types

2004-12-01 Thread Michael Fuhr
On Wed, Dec 01, 2004 at 06:07:34PM +0800, Andrew Thorley wrote: > > Did you type the SQL statements and/or error messages instead > > of cutting and pasting? > > yes i C&P'ed the SQL code & error code. But did you copy the error message associated with the SQL code you copied, or did you copy so

Re: [SQL] SET AUTOCOMMIT TO OFF

2004-12-01 Thread Tom Lane
Christoph Haller <[EMAIL PROTECTED]> writes: > Please, could someone point me to the right list > or tell me how to do a "SET AUTOCOMMIT TO OFF" within libpq. libpq does not have any support for that. regards, tom lane ---(end of broadcast)--

[SQL] SET AUTOCOMMIT TO OFF

2004-12-01 Thread Christoph Haller
Please, could someone point me to the right list or tell me how to do a "SET AUTOCOMMIT TO OFF" within libpq. The case is pretty urgent, as we have to move our applications to Linux and thought it's better to use PG7.4. We used to have PG7.3 under HPUX, and we think of a temporary downgrade ba