Re: [JDBC] Create index statement does nothing - Mailing list pgsql-jdbc

From Laurenz Albe
Subject Re: [JDBC] Create index statement does nothing
Date
Msg-id 1507704951.2627.5.camel@cybertec.at
Whole thread Raw
In response to [JDBC] Create index statement does nothing  ("Bowman, Randall" <randall.bowman@spglobal.com>)
List pgsql-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

pgsql-jdbc by date:

Previous
From: Robert Price
Date:
Subject: [JDBC] Spring Transactional Support
Next
From: Dave Cramer
Date:
Subject: Re: [JDBC] Spring Transactional Support