X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C59D99FA30D for ; Fri, 23 Jun 2006 21:22:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 36414-07 for ; Fri, 23 Jun 2006 21:21:56 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.199]) by postgresql.org (Postfix) with ESMTP id 318709F9AD3 for ; Fri, 23 Jun 2006 21:21:56 -0300 (ADT) Received: by wx-out-0102.google.com with SMTP id s13so626338wxc for ; Fri, 23 Jun 2006 17:21:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:in-reply-to:thread-index:x-mimeole; b=TqnDYNQWUO3cAzfbI/JHvIQtY7Q5loiBUyoLmQ3q+ajtxH68SoAIc9BNmtqceaKAUDl1IjQsmGWmFXQbA2ljEeLaE3itnAZgJeKG7m5KV2kbkt3ZL8QWrS18k800OUVjzNP1scyRbDmSez5rnriVmP4utpLEllalTV2ANYShlpI= Received: by 10.70.68.16 with SMTP id q16mr5540878wxa; Fri, 23 Jun 2006 17:21:51 -0700 (PDT) Received: from franklin ( [201.2.219.138]) by mx.gmail.com with ESMTP id h8sm2932600wxd.2006.06.23.17.21.50; Fri, 23 Jun 2006 17:21:51 -0700 (PDT) From: "Franklin Haut" To: Subject: RES: Temporary table Date: Fri, 23 Jun 2006 21:27:40 -0300 Message-ID: <000001c69725$01fc3d90$8adb02c9@franklin> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 In-reply-to: <039001c69711$81058a60$0202fea9@aus.pervasive.com> Thread-Index: AcaWJ6kB91I7F+1CQfamxokjjD/fiQAycwtQAAeoJXAAAFL0AAAE3cJQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.504 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/469 X-Sequence-Number: 19826 Ok, it works. Thanks Franklin=20 -----Mensagem original----- De: Larry Rosenman [mailto:ler@lerctr.org]=20 Enviada em: sexta-feira, 23 de junho de 2006 19:08 Para: 'Franklin Haut'; pgsql-performance@postgresql.org Assunto: RE: [PERFORM] Temporary table Franklin Haut wrote: > Hello, >=20 > I=B4m have some problems with a temporary table, i need create a = table,=20 > insert some values, make a select and at end of transaction the table=20 > must droped, but after i created a table there not more exist, is this = > normal ? >=20 > How to reproduce : >=20 >=20 > CREATE TEMP TABLE cademp ( > codemp INTEGER, > codfil INTEGER, > nomemp varchar(50) > ) ON COMMIT DROP; >=20 > INSERT INTO cademp (codemp, codfil, nomemp) values (1,1,'TESTE'); > INSERT INTO cademp (codemp, codfil, nomemp) values (1,2,'TESTE1'); >=20 > Select * from cademp; >=20 >=20 >=20 > In this case, the table cademp doesn=B4t exist at the first insert, in = > the same transaction. >=20 It is NOT the same transaction. By default, each STATEMENT is it's own transaction. Stick a BEGIN; before the create table, and a commit; after the select. Larry Rosenman >=20 >=20 >=20 > Tks, >=20 > Franklin >=20 >=20 > ---------------------------(end of > broadcast)--------------------------- TIP 6: explain analyze is your=20 > friend --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 512-248-2683 E-Mail: ler@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3893