Re: [SQL] from PG_DUMP to CVS

2004-08-28 Thread Philip Warner
e from the information stored in a dump file, without parsing SQL. OTOH, it might be nice to add some more information to the dump file. -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ -

Re: [SQL] from PG_DUMP to CVS

2004-08-27 Thread Philip Warner
aint/create.sql ... some-dbname/some-schema/ACL/some-table.sql some-dbname/some-schema/ACL/some-function(int).sql ... etc. This would be easy. Question is, how useful would it be? -------- Philip Warner| __---

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Philip Warner
ied before satisfy all your needs? -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.B.N. 75 008 659 498) | /(@) __---_ Tel: (+61) 050

Re: [SQL] from PG_DUMP to CVS

2004-08-26 Thread Philip Warner
fusing when ACLs and constraints were dumped (eg. they would not appear under the tables). But it would be consistent, at least. Of course it would be impossible to restore from such a beast since we would be throwing away ordering -- I think. ---

Re: [SQL] create index on function - why?

2002-12-22 Thread Philip Warner
would it be hard to allow mixed indexes: create table users(id integer, last_name text); create index users_id_name on users(id,lower(name)); ? Philip Warner| __---_ Albatross Consulting Pty

Re: [SQL] Help on (sub)-select

2002-12-20 Thread Philip Warner
d it enough to debug it. Replace the two occurrences of r.* with the list of fields in r that you want to group the count by. -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ -

Re: [SQL] Help on (sub)-select

2002-12-20 Thread Philip Warner
should get the idea -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.B.N. 75 008 659 498) | /(@) __---_ Tel: (+61) 0500 83 82 81 | _ \ Fax

Re: [SQL] Performance Problems

2002-12-12 Thread Philip Warner
RBOSE ? Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.B.N. 75 008 659 498) | /(@) __---_ Tel: (+61) 0500 83 82 81 | _ \ Fax: (+61) 03 5330 3172 | ___ |

Re: [SQL] EXIST / NOT EXIST

2002-12-03 Thread Philip Warner
At 09:01 AM 3/12/2002 +0100, Rachel.Vaudron wrote: I would like to know if the keyword EXIST can be used with PostgreSQL ? EXISTS is supported (ie. trailing 'S'). -------- Philip Warner| __---_

Re: [SQL] Re: Restriction by grouping problem.

2001-07-27 Thread Philip Warner
hereas the original syntax above should just use 2 entries. Like I said, it's just an optimizer hint. Philip Warner| __---_ Albatross Consulting Pty. Ltd. |---

Re: [SQL] Re: Restriction by grouping problem.

2001-07-27 Thread Philip Warner
At 11:47 27/07/01 +1000, Philip Warner wrote: > >...the FROM statement would be a lot nicer if your had a table of SIDs, or >at least had a good way of generating the list of SIDs. > A final (& possibly best) option, is: Select MDT.GETFILE, [anything

Re: [SQL] Re: Restriction by grouping problem.

2001-07-26 Thread Philip Warner
4). Now a >select getfile, datetime, logid from logs where sid = onevalue; would return >a set of rows for that sid, the row I want is for the one with the smallest >aka min(datetime) and I want this for every row in the table. --------

Re: [HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-29 Thread Philip Warner
At 13:16 30/03/01 +0900, Hiroshi Inoue wrote: >Philip Warner wrote: >> >> At 19:14 29/03/01 -0800, Mikheev, Vadim wrote: >> >> >Reported problem is caused by bug (only one tuple version must be >> >> >returned by SELECT) and this is way to fix

RE: [HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-29 Thread Philip Warner
- I can fix it in two hours. >The question is - should we do this now? >Comments? It's a bug; how confident are you of the fix? -------- Philip Warner| __---_ Albatross Consult

RE: [HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-29 Thread Philip Warner
At 09:58 28/03/01 -0800, Mikheev, Vadim wrote: > >Reported problem is caused by bug (only one tuple version must be >returned by SELECT) and this is way to fix it. > I assume this is not possible in 7.1? ---- P

Re: [HACKERS] Re: [SQL] possible row locking bug in 7.0.3 & 7.1

2001-03-27 Thread Philip Warner
hat SELECT and SELECT...FOR UPDATE should return the same result set. >But I wonder whether we ought to rethink the MVCC rules so that that's >not necessary. I have no idea how we might change the rules though. Disallowing visibility of two versions of the same row would help. --

Re: [SQL] pg_dump error

2001-01-15 Thread Philip Warner
deleting it. Also, can you confirm that the username under which you run pg_dump has the rights to create tables? -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \

Re: [SQL] Subselect in join?

2000-11-29 Thread Philip Warner
At 18:24 29/11/00 -0600, Kenn Thompson wrote: > >In english- is it not possible to to a subselect in a FROM clause? > In 7.1. ---- Philip Warner| __---_ Albatross Consulting

Re: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Philip Warner
nally, custom 'CHECK' constraints could be designed for exactly this purpose (I have done this in DBs before). Philip Warner| __---_ Albatross Consultin

Re: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Philip Warner
ete the file, and we don't want partially loaded batches if the machine crashes. I admit this example demonstrates my age, but this kind of processing is still necessary. Philip Warner

Re: [SQL]

2000-10-30 Thread Philip Warner
h that should work is: select col1 from TABLE_A WHERE COL2 = 1 order by col2, col1 desc limit 1; and you will need an index on (col2, col1). -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ -

Re: [SQL] Can I use subselect as a function parameter?

2000-10-11 Thread Philip Warner
discussion at least resolved the meaning, but not the locking issues. -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.B.N. 75 008 659 498) | /(@) __---_ Tel: (+61) 0500 83 82 81 | _ \ F

Re: [SQL] how can I mirror a postgres database

2000-09-30 Thread Philip Warner
7.1 will have replication curtesy of PostgreSQL Inc: http://www.pgsql.com/press/Pgsql_Inc_Press-5.pdf (it is being freely donated to the source tree, according to their statement) Philip Warner

[SQL] Change of behaviour of pg_get_userbyid & pg_get_viewdef - do it?

2000-09-27 Thread Philip Warner
Based on the lack of reaction on GENERAL and SQL, I am inclined to go ahead with the changes below at least as far as returning NULL instead of 'Not a View' or 'unknown (UID=)' (as per Tom's request), if noone objects... At 13:15 24/09/00 +1000, Philip Warner

[SQL] Re: [HACKERS] RFC - change of behaviour of pg_get_userbyid & pg_get_viewdef?

2000-09-24 Thread Philip Warner
ally means 'nothing found'. -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.B.N. 75 008 659 498) | /(@) __---_ Tel: (+61) 0500 83 82 81 | __

Re: [Fwd: Re: [SQL] no ORDER BY in subselects?]

2000-09-21 Thread Philip Warner
e date_field and id are not correlated, but you want the id corresponding to the next date). Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.B.N. 75 008 659 498) | /(@) __---

Re: [Fwd: Re: [SQL] no ORDER BY in subselects?]

2000-09-20 Thread Philip Warner
At 09:20 20/09/00 -0700, Josh Berkus wrote: >Ooops, posted this to Phillip rather than the list, sorry Phillip ... > >Folks, > >Philip Warner wrote: >> >> At 15:23 20/09/00 +0200, Louis-David Mitterrand wrote: >> > >> >ERROR: parser: parse erro

Re: [SQL] no ORDER BY in subselects?

2000-09-20 Thread Philip Warner
At 15:23 20/09/00 +0200, Louis-David Mitterrand wrote: > >ERROR: parser: parse error at or near "order" > >Aren't ORDER BY clauses allowed in subselects? > It is a very very sad fact, but, no, they're not. -------

[SQL] Does optimizer know about 'constant' expressions?

2000-09-17 Thread Philip Warner
114 117 65 ] :constbyval false })})) :indxorderdir 1 } NOTICE: QUERY PLAN: Index Scan using ping_ix1 on ping (cost=0.00..61.98 rows=18 width=12) EXPLAIN Philip Warner| __---_ Albatross Con

Re: [SQL] Operator Precedence problem?

2000-08-12 Thread Philip Warner
like in math, where in an >equation, I expect that the multiplication (and) is done before the >addition (or). Unless modified by parentheses just as in your second >example. You're quite right; I think I must have been punch drunk from beating my head against another problem. Thanks. ---

[SQL] Operator Precedence problem?

2000-08-11 Thread Philip Warner
ur in simple test databases must be a bug, I think. Any help or explanation would be appreciated... Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.B.N. 75 008 659 498) | /(@) __

Re: [SQL] Subselect and limit/order?

2000-08-07 Thread Philip Warner
get some benefit (in colun select expressions at least) by being able to do an implied 'limit 2'? -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd.

Re: [SQL] Subselect and limit/order?

2000-08-07 Thread Philip Warner
At 11:46 7/08/00 -0400, Tom Lane wrote: >Philip Warner <[EMAIL PROTECTED]> writes: >> Just wondering why subselect expressions can not have a limit/order clause, > >We could ignore the spec and implement this as an extension, but I'd >want to see some fairly compell

Re: [SQL] Functions too slow, even with iscachable?

2000-08-07 Thread Philip Warner
on is cacheable... -------- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.C.N. 008 659 498) | /(@) __---_ Tel: (+61) 0500 83 82 81 | _ \ Fax: (+61) 0500 83 82 82 | ___

[SQL] Subselect and limit/order?

2000-08-07 Thread Philip Warner
x27;s an oversight or a planner problem? ---- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.C.N. 008 659 498) | /(@) __---_ Tel: (+61) 0500

Re: [SQL] Functions too slow, even with iscachable?

2000-08-07 Thread Philip Warner
Mon Aug 7 21:49:05 2000 @@ -61,6 +61,7 @@ char *prosrc; char *probin; char *usename; + int iscachable; /* Attr */ int dumped; /* 1 if already dumped */ } FuncInfo;

Re: [SQL] Functions too slow, even with iscachable?

2000-08-07 Thread Philip Warner
At 17:11 7/08/00 +0800, Ang Chin Han wrote: > >BTW, pg_dump doesn't seem to preserve the iscachable attribute. Bug? > Don't know about the rest of your message, but this seems to be a bug. I'll look into it some more... ---

[SQL] Strange strategy with COALESCE?

2000-08-04 Thread Philip Warner
column (b). ---- Philip Warner| __---_ Albatross Consulting Pty. Ltd. |/ - \ (A.C.N. 008 659 498) | /(@) __---_ Tel: (+61) 0500 83 82 81 | _ \

Re: [SQL] SQL question

2000-07-16 Thread Philip Warner
gt;about as braindead a choice as I can think of, but that's what it did. > Out of curiosity, what does it do now? -------- Philip Warner| __---_ Albatross Consulting Pty. L

Re: [SQL] SQL question

2000-07-16 Thread Philip Warner
e would be to define a 'coalesce' function (I don't think PG has one), which takes an arbitrary number of arguments and returns the first non-null one. You could then say "where coalesce(start_date_time, '1/1/1500')::date >= '01/01/2000

Re: [SQL] SQL question

2000-07-16 Thread Philip Warner
:date <= '01/01/2001'::date; > >Is this a bug? Or there's an logical explaination for this? The most logical explanation is that there are no null values in start_date_time when account_no = 1. Try select count(*) from table1 where