Re: [JDBC] Create index statement does nothing

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: [JDBC] Create index statement does nothing
Дата
Msg-id 1507704951.2627.5.camel@cybertec.at
обсуждение исходный текст
Ответ на [JDBC] Create index statement does nothing  ("Bowman, Randall" <randall.bowman@spglobal.com>)
Список 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 по дате отправления:

Предыдущее
От: Robert Price
Дата:
Сообщение: [JDBC] Spring Transactional Support
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: [JDBC] Spring Transactional Support