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

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

2007-10-08 Thread Peter Childs
not three... You may want to use views to simplify things. Peter Childs Andreas > -- > Andreas Kretschmer > Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) > GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net > > ---

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

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 wo

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

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

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

2006-01-02 Thread Peter Childs
rs are going to miss 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
esired result >b) if so what would it be. > > 4) remarks > > i can get the solution using a temporary table and with repeated > "insert into temporary select $column from main_table" > > select distinct t from (select string_A as t from main_table union

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! > >

Re: [SQL] List table with same column name

2003-10-23 Thread Peter Childs
ded 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 po

Re: [SQL] FK Constraints, indexes and performance

2003-10-05 Thread Peter Childs
eys so that they could be used for an extra preformace gain. but a think that may have 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 * > fro

Re: [SQL] A generic trigger?

2003-09-14 Thread Peter Childs
There are some scripting languages where somthing don't work hense why I chose pl/python The trigger/function is below although it should be in the archives somwhere as well. Full problem with it can be seen of Bugs Peter Childs -- CREATE TABLE history ( tab t

Re: [SQL] [OT] Frontend recommendations

2003-07-25 Thread Peter Childs
(Thats under Linux...) If you need a quick 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..

Re: [SQL] Complex outer joins?

2003-03-24 Thread Peter Childs
table this query can be rewritten as select G.SELID, G.TEXT, L.ID as SELLEVELID , L.SELLEVEL, L.LEVELJOIN, L.LEVELTEXT, 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.SE

Re: [SQL] Question on SQL and pg_-tables

2002-11-27 Thread Peter Childs
d methods. Which means using standard libraries is a waste of time. Perhaps we need a standard set of "views" to tell us the meta data then to get at the meta data in a different database all you would need to do is reimplemented the views but this is rather a dirty solution. To something which is missing in the standard Peter Childs ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org