Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2AwV-0004Yw-3V for pgsql-jdbc@arkaria.postgresql.org; Wed, 11 Oct 2017 06:56:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e2AwU-0006jY-7J for pgsql-jdbc@arkaria.postgresql.org; Wed, 11 Oct 2017 06:56:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e2Avx-0004uZ-64 for pgsql-jdbc@postgresql.org; Wed, 11 Oct 2017 06:56:01 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e2Avt-0001lF-Vt for pgsql-jdbc@postgresql.org; Wed, 11 Oct 2017 06:56:00 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 4264346C1F; Wed, 11 Oct 2017 08:55:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id c0mMfbQ7kPiS; Wed, 11 Oct 2017 08:55:52 +0200 (CEST) Message-ID: <1507704951.2627.5.camel@cybertec.at> Subject: Re: Create index statement does nothing From: Laurenz Albe To: "Bowman, Randall" , "pgsql-jdbc@postgresql.org" Date: Wed, 11 Oct 2017 08:55:51 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Randall Bowman wrote: > I’m executing a create index statement in jdbc. > The statement executes without error but the index does not show up in the database. > I execute “select * from pg_indexes where tablename = 'mkteodprice'” in pgAdmin > and it returns no rows. > When I execute > "create index "Temp_4419_1507660884753" on systestdata01p.mktEODPrice ( priceDate, tradingItemId, PacVerToFeedPop )" > in pgAdmin the index is created as expected. > The java statement that I’m using is “int n = _statement.executeUpdate( sql );” > Later in the java code I attempt to drop the index and it fails because the index > does not exist. >   > Log entry for create: > sendParse  FE=> Parse(stmt=null,query="BEGIN",oids={}) > sendBind  FE=> Bind(stmt=null,portal=null) > sendExecute  FE=> Execute(portal=null,limit=0) > sendParse  FE=> Parse(stmt=null,query="create index "Temp_4419_1507660884753" on systestdata01p.mktEODPrice ( priceDate, tradingItemId, PacVerToFeedPop )",oids={}) > sendBind  FE=> Bind(stmt=null,portal=null) > sendDescribePortal  FE=> Describe(portal=null) > sendExecute  FE=> Execute(portal=null,limit=1) > sendSync  FE=> Sync > processResults  <=BE ParseComplete [null] > processResults  <=BE BindComplete [unnamed] > receiveCommandStatus  <=BE CommandStatus(BEGIN) > processResults  <=BE ParseComplete [null] > processResults  <=BE BindComplete [unnamed] > processResults  <=BE NoData > receiveCommandStatus  <=BE CommandStatus(CREATE INDEX) > receiveRFQ  <=BE ReadyForQuery(T) That looks like the CREATE INDEX is tunning inside a transaction, because it is preceeded by a BEGIN. If that transaction is not committed, it is not surprising that the index is not there afterwards. I would turn on statement logging on the PostgreSQL server to see what arrives at the backend. Yours, Laurenz Albe -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc