Re: [SQL] trigger for TRUNCATE?

2008-01-14 Thread Peter Childs
On 11/01/2008, Simon Riggs [EMAIL PROTECTED] wrote: On Fri, 2008-01-11 at 08:24 +, Richard Huxton wrote: I've always considered TRUNCATE to be DDL rather than DML. I mentally group it with DROP TABLE rather than DELETE DDL/DML probably isn't the right split, since its then arguable as

Re: [SQL] Get different sums from the same table in one query

2007-10-08 Thread Peter Childs
= CURRENT_DATE AND telecom_operator_id 0 AND telephone_number IN ( $numbers ) GROUP BY date_in You may have to play to get exactly what you want but here worse case your only doing one scan of the table not three... You may want to use views to simplify things. Peter Childs

Re: [SQL] Increment a sequence by more than one

2007-08-06 Thread Peter Childs
On 03/08/07, Michael Glaesemann [EMAIL PROTECTED] wrote: On Aug 3, 2007, at 15:27 , Erik Jones wrote: Is there actually a requirement that the block of 5000 values not have gaps? Good point. If not, why not make the versioned table's id column default to nextval from the same

Re: [SQL] is there a 'table' data type in pg?

2007-07-24 Thread Peter Childs
On 24/07/07, Louis-David Mitterrand [EMAIL PROTECTED] wrote: On Tue, Jul 24, 2007 at 03:10:44PM +0100, Gregory Stark wrote: Louis-David Mitterrand [EMAIL PROTECTED] writes: Can I use a another column to store the type of the id_subject (ie: the tabled it belongs to) ? Then I would be able

Re: [SQL] Selecting rows with static ordering

2007-04-26 Thread Peter Childs
On 27/04/07, Aaron Bono [EMAIL PROTECTED] wrote: On 4/26/07, Steve Midgley [EMAIL PROTECTED] wrote: So take for example this foreign application variable: ids = 3,2,5,1,4 The application then executes this sql: select * from table where id in (3,2,5,1,4) As-is, of course, the

Re: [SQL] join a lot of columns of two tables

2006-12-14 Thread Peter Childs
On 14/12/06, ivan marchesini [EMAIL PROTECTED] wrote: Dear Postgres Users, I have 2 tables... each one has a column called ID (primary keys of each table) the values into each ID column are exactly the same. each table has a lot of other columns (around 50 for each table) I would like to

Re: [SQL] Autovaccum

2006-11-30 Thread Peter Childs
On 30/11/06, Alvaro Herrera [EMAIL PROTECTED] wrote: Ezequias Rodrigues da Rocha wrote: Hi list, I would like to know if it is necessary to set my database to autovaccum if the intent of my DB Manager is do not make any deletion in any time. If there is no deletions why autovaccum ok ?

[SQL] delete from a using b in postgres 8.1.

2006-01-02 Thread Peter Childs
it before it goes back to the end user. I also don't think this has been made particularly clear in changes. Peter Childs

Re: [SQL] a wierd query

2004-05-13 Thread Peter Childs
from main_table); or select f from (select A as t from main_table union select B as t from main_table) group by t order by t; hope that helps Peter Childs ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] List table with same column name

2003-10-23 Thread Peter Childs
for 7.3. 2 Do you really need to know that column a in table 1 also appears in table 1? Peter Childs Thanks ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster -- -Achilleus ---(end of broadcast

Re: [SQL] List table with same column name

2003-10-23 Thread Peter Childs
On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: On Thu, 23 Oct 2003, Peter Childs wrote: On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: On Thu, 23 Oct 2003, Abdul Wahab Dahalan wrote: Hi! How do I list all the tables in the database which has a same column name?. SELECT

Re: [SQL] FK Constraints, indexes and performance

2003-10-05 Thread Peter Childs
got on the todo list. Peter Childs The reason I think PG is doing sequential scans is because the execution plan for the following query shows two sequential scans: explain select * from parent, child where child.parentId = parent.id With reference to the above, two (2) questions: 1

Re: [SQL] A generic trigger?

2003-09-14 Thread Peter Childs
. Full problem with it can be seen of Bugs Peter Childs -- CREATE TABLE history ( tab textfieldtext action textbefore text aftertextoccured timestamp without

Re: [SQL] [OT] Frontend recommendations

2003-07-25 Thread Peter Childs
gui try pgaccess and the like. If you want to writea full gui pick you favoute language and there should be some postgres drivers (if all else fails there is always ODBC) somthing like perl or python may be nice and platform independant Peter Childs best regards, Ries

Re: [SQL] Complex outer joins?

2003-03-24 Thread Peter Childs
, C.ID as KRITERIENFELDID, C.SELFLD from table as G, table as L, table as C where and G.SELID = L.SELID and L.SELID = C.SELID and L.SELLEVEL = C.SELLEVEL; Where table is the name of the table I hope that helps Peter Childs