pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedweird problem when running a sql stmt
2+ messages / 2 participants
[nested] [flat]
* weird problem when running a sql stmt
@ 2016-12-14 17:59 Andrés Ramírez <sunshavi@fastmail.fm>
0 siblings, 0 replies; 2+ messages in thread
From: sunshavi@fastmail.fm @ 2016-12-14 17:59 UTC (permalink / raw)
To: pgsql-odbc
Hi.
I have those version:
--8<---------------cut here---------------start------------->8---
psqlodbc 09.05.0400
postgresql 9.6.1-3
--8<---------------cut here---------------end--------------->8---
This is my .odbc.ini (my odbcinst.ini file is empty):
--8<---------------cut here---------------start------------->8---
[invcross_test]
Driver = /usr/lib/psqlodbcw.so
Database = invcross_test
--8<---------------cut here---------------end--------------->8---
My c prg connects using dsn:
--8<---------------cut here---------------start------------->8---
dsn=invcross_test;uid=okipuyuc
--8<---------------cut here---------------end--------------->8---
This is my table:
--8<---------------cut here---------------start------------->8---
\d store_product_detail_envers
invcross_test=> Table "public.store_product_detail_envers"
Column | Type | Modifiers
-------------------------+-----------------------------+--------------------------------------------------------------------------
id | integer | not null default nextval('store_product_detail_envers_id_seq'::regclass)
store_product_detail_id | integer | not null
value | numeric(19,2) | not null
effect_date | timestamp without time zone | not null
end_date | timestamp without time zone |
enable | smallint | not null
type | character(1) | not null
created_by | integer | not null
updated_by | integer |
created_at | timestamp without time zone | not null
updated_at | timestamp without time zone |
Indexes:
"store_product_detail_envers_pkey" PRIMARY KEY, btree (id)
"ifk_store_product_detail__enve" btree (store_product_detail_id)
"store_product_detail_envers_fkindex1" btree (store_product_detail_id)
Foreign-key constraints:
"store_product_detail_envers_store_product_detail_id_fkey" FOREIGN KEY (store_product_detail_id) REFERENCES store_product_details(id)
--8<---------------cut here---------------end--------------->8---
When running this statement:
--8<---------------cut here---------------start------------->8---
update store_product_detail_envers set end_date =now(), updated_by =1, updated_at =now() where store_product_detail_id =2 and end_date IS NULL and type ='C';
--8<---------------cut here---------------end--------------->8---
I get this from the extract_error function:
--8<---------------cut here---------------start------------->8---
The driver reported the following diagnostics whilst running:
update store_product_detail_envers set end_date =now(), updated_by =1, updated_at =now() where store_product_detail_id =2 and end_date IS NULL and type ='C';
--8<---------------cut here---------------end--------------->8---
If the statement is run from isql (it Works):
--8<---------------cut here---------------start------------->8---
isql invcross_test okipuyuc
--8<---------------cut here---------------end--------------->8---
Any idea how to solve Or Debug this?
Also I tried adding this on .odbc.ini (no idea where the logs are):
--8<---------------cut here---------------start------------->8---
Debug = 1
CommLog = 1
--8<---------------cut here---------------end--------------->8---
My distro is Archlinux. Regards
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: weird problem when running a sql stmt
@ 2016-12-15 06:01 Andres Ramirez <sunshavi@fastmail.fm>
0 siblings, 0 replies; 2+ messages in thread
From: Andres Ramirez @ 2016-12-15 06:01 UTC (permalink / raw)
To: pgsql-odbc
Hi.
I think the issue was the update statement was not finding
matches(rows) to update.
I have changed src code to just update when there are rows matching
the criteria.
Regards
--
On Wed, Dec 14, 2016 at 12:59 PM, Andrés Ramírez <sunshavi@fastmail.fm> wrote:
> Hi.
> I have those version:
> --8<---------------cut here---------------start------------->8---
> psqlodbc 09.05.0400
> postgresql 9.6.1-3
> --8<---------------cut here---------------end--------------->8---
>
> This is my .odbc.ini (my odbcinst.ini file is empty):
> --8<---------------cut here---------------start------------->8---
> [invcross_test]
> Driver = /usr/lib/psqlodbcw.so
> Database = invcross_test
> --8<---------------cut here---------------end--------------->8---
>
> My c prg connects using dsn:
> --8<---------------cut here---------------start------------->8---
> dsn=invcross_test;uid=okipuyuc
> --8<---------------cut here---------------end--------------->8---
>
> This is my table:
> --8<---------------cut here---------------start------------->8---
> \d store_product_detail_envers
> invcross_test=> Table "public.store_product_detail_envers"
> Column | Type | Modifiers
> -------------------------+-----------------------------+--------------------------------------------------------------------------
> id | integer | not null default nextval('store_product_detail_envers_id_seq'::regclass)
> store_product_detail_id | integer | not null
> value | numeric(19,2) | not null
> effect_date | timestamp without time zone | not null
> end_date | timestamp without time zone |
> enable | smallint | not null
> type | character(1) | not null
> created_by | integer | not null
> updated_by | integer |
> created_at | timestamp without time zone | not null
> updated_at | timestamp without time zone |
> Indexes:
> "store_product_detail_envers_pkey" PRIMARY KEY, btree (id)
> "ifk_store_product_detail__enve" btree (store_product_detail_id)
> "store_product_detail_envers_fkindex1" btree (store_product_detail_id)
> Foreign-key constraints:
> "store_product_detail_envers_store_product_detail_id_fkey" FOREIGN KEY (store_product_detail_id) REFERENCES store_product_details(id)
> --8<---------------cut here---------------end--------------->8---
>
>
> When running this statement:
> --8<---------------cut here---------------start------------->8---
> update store_product_detail_envers set end_date =now(), updated_by =1, updated_at =now() where store_product_detail_id =2 and end_date IS NULL and type ='C';
> --8<---------------cut here---------------end--------------->8---
>
> I get this from the extract_error function:
> --8<---------------cut here---------------start------------->8---
> The driver reported the following diagnostics whilst running:
> update store_product_detail_envers set end_date =now(), updated_by =1, updated_at =now() where store_product_detail_id =2 and end_date IS NULL and type ='C';
> --8<---------------cut here---------------end--------------->8---
>
> If the statement is run from isql (it Works):
> --8<---------------cut here---------------start------------->8---
> isql invcross_test okipuyuc
> --8<---------------cut here---------------end--------------->8---
>
> Any idea how to solve Or Debug this?
>
> Also I tried adding this on .odbc.ini (no idea where the logs are):
> --8<---------------cut here---------------start------------->8---
> Debug = 1
> CommLog = 1
> --8<---------------cut here---------------end--------------->8---
>
> My distro is Archlinux. Regards
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-12-15 06:01 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-12-14 17:59 weird problem when running a sql stmt Andrés Ramírez <sunshavi@fastmail.fm>
2016-12-15 06:01 Re: weird problem when running a sql stmt Andres Ramirez <sunshavi@fastmail.fm>
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