pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Bowman, Randall <randall.bowman@spglobal.com>
To: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Create index statement does nothing
Date: Wed, 11 Oct 2017 08:55:51 +0200
Message-ID: <1507704951.2627.5.camel@cybertec.at> (raw)
In-Reply-To: <SN1PR10MB0639B2E64F75D1D95FEBF3B1F3750@SN1PR10MB0639.namprd10.prod.outlook.com>
References: <SN1PR10MB0639B2E64F75D1D95FEBF3B1F3750@SN1PR10MB0639.namprd10.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

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



view thread (2+ messages)

Message-ID: <1507704951.2627.5.camel@cybertec.at>
Permalink:  ../1507704951.2627.5.camel@cybertec.at/
Also on:    postgresql.org/message-id/1507704951.2627.5.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: laurenz.albe@cybertec.at, randall.bowman@spglobal.com
  Subject: Re: Create index statement does nothing
  In-Reply-To: <1507704951.2627.5.camel@cybertec.at>
  References: <SN1PR10MB0639B2E64F75D1D95FEBF3B1F3750@SN1PR10MB0639.namprd10.prod.outlook.com> <1507704951.2627.5.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox