Question re: pldbgapi

2018-06-19 Thread Steven Hirsch
Hi, all. I'm trying to debug a rather complicated function using pldbgapi in pgAdmin III and am running into an annoying problem. In order to set breakpoints, I need to execute the query that invokes the function. It then stops at the first line and allows me to set breakpoints. However, I

Re: Fwd: Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2

2018-04-11 Thread Steven Hirsch
On Wed, 11 Apr 2018, karthik kumar wrote: This is the error we see in the ODBC trace log         DIAG [08001] [IBM][CLI Driver] SQL30081N  A communication error has been detected. Communication protocol being used: "TCP/IP".  Communication API being used: "SOCKETS".  Location where the error

Re: Fwd: Carto ODBC_FDW issue "ERROR: Connecting to driver" from PG to DB2

2018-04-11 Thread Steven Hirsch
On Wed, 11 Apr 2018, karthik kumar wrote: Hello Adrian I built fdw with debug option and ran it with debug option.  Here is the output postgres=# select * from odbc_testt; DEBUG:  StartTransactionCommand DEBUG:  StartTransaction DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR,

Re: FDW with DB2

2018-04-06 Thread Steven Hirsch
On Fri, 6 Apr 2018, Ravi Krishna wrote: the CartoDB ODBC driver works quite well.  I've used it to move a large amount of data from DB2 and Netezza databases.   ​Hello Steven Will it be OK if I or my team reach out to you for any guidance/help. To the extent that questions on

Re: FDW with DB2

2018-04-06 Thread Steven Hirsch
On Fri, 6 Apr 2018, Ravi Krishna wrote: There are two ODBC drivers. One does not compile and the other one piggy backs on a community effort for Cartodb. Looks like Db2 is used by very few and even less want a divorce from DB2 -> no motivation to write native FDW like that for Oracle :-) the

Re: decompose big queries

2018-04-06 Thread Steven Hirsch
On Fri, 6 Apr 2018, pinker wrote: Edson Carlos Ericksson Richter wrote I don't know if there are best practices (each scenario requires its own solution), but for plain complex SELECT queries, I do use "WITH" queries... They work really well. Be cautious with CTE's. They weren't meant to be a

Re: Introducing brand-new dbForge Studio for PostgreSQL, a powerful IDE for working with PostgreSQL databases

2018-03-22 Thread Steven Hirsch
On Thu, 22 Mar 2018, Devart wrote: /Devart announced the first release of dbForge Studio for PostgreSQL that allows to manage and develop database objects in PostgreSQL. This new IDE offers many robust features like Code Completion, Object Explorer and Data Editor which help users create, develo

psql '\copy to' and unicode escapes

2018-02-26 Thread Steven Hirsch
I fear that I'm missing something very obvious, but I cannot find a syntax that permits me to use an escaped hexadecimal representation in a CSV file and have that representation interpreted as the equivalent unicode character when inserting into the database. Both client and server are using UTF8

Re: Odd behavior with 'currval'

2018-02-09 Thread Steven Hirsch
On Fri, 9 Feb 2018, Francisco Olarte wrote: I was trying to be careful and changed the address manually for all messages except this one. Do not bother with that. The style in this list is to just reply to all, so the people that are participating in the thread can get a copy of the messages i

Re: Odd behavior with 'currval'

2018-02-09 Thread Steven Hirsch
On Fri, 9 Feb 2018, Adrian Klaver wrote: I remember seeing it, so I went back to look at the message. Turns out you sent it to me only. Unfortunately I am not a Java programmer so I did not catch the error. For the record: Ah, blast... Apologies to everyone concerned. I need to understand w

Re: Odd behavior with 'currval'

2018-02-09 Thread Steven Hirsch
On Fri, 9 Feb 2018, Francisco Olarte wrote: This may sound a bit harsh but: The culprit is in the JDBC domain, NOT PostgreSQL! According to the documentation I found, the ResultSet 'getLong()' method returns a value of zero when it sees NULL as an input. Why the JDBC libs don't treat this as

Re: Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
On Thu, 8 Feb 2018, David G. Johnston wrote: new_db=# \dfS+ currval List of functions Schema | Name | Result data type | Argument data types | Type | Volatility | Parallel | Owner | Security | Access privileges | Language | Source code | Des cription +-+-

Re: Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
On Thu, 8 Feb 2018, David G. Johnston wrote: On Thu, Feb 8, 2018 at 12:54 PM, David G. Johnston wrote:  The only 'currval' procedure is the one defined at installation (in public). ​So, the installed version of currval would be defined in "pg_catalog", not "public" ... ?? Al

Re: Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
On Thu, 8 Feb 2018, David G. Johnston wrote: On Thu, Feb 8, 2018 at 10:58 AM, Steven Hirsch wrote: On a hunch, I tried 'SELECT currval(NULL)' to see if it returned '0', but that too returns NULL.  So, where is the '0' coming from wh

Re: Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
On Thu, 8 Feb 2018, Adrian Klaver wrote: hplc=> \d student_attendance_attendance_id_seq Sequence "public.student_attendance_attendance_id_seq" Column | Type |Value ---+-+-- sequence_name | name| student_att

Re: Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
On Thu, 8 Feb 2018, Adrian Klaver wrote: SELECT currval('udm_asset_type_definition_id_seq'); Arrgh my mistake, the above should have been SELECT currval('udm_asset_type_definition_def_id_seq'); [Code: , SQL State: 55000] ERROR: currval of sequence "udm_asset_type_definition_def_id_seq" is

Re: Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
On Thu, 8 Feb 2018, Melvin Davidson wrote: I believe your problem is in your usage. In order for currval(regclass) to work, you must first do a SELECT nextval(regclass) in your _current transaction_! https://www.postgresql.org/docs/9.6/static/functions-sequence.html I AM doing that. It is re

Re: Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
On Thu, 8 Feb 2018, Adrian Klaver wrote: What if you do?: SELECT * FROM udm_asset_type_definition_def_id_seq; I get: udm_asset_type_definition_def_id_seq21 1 1 9223372036854775807 1 1 32 false true SELECT currval('udm_asset_type_definition_id_s

Re: Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
On Thu, 8 Feb 2018, Francisco Olarte wrote: Something must be different. As requested by others, try posting the SQL code chunks, more eyeballs make bugs shallower ( it's happened several times to me, make a typo, go over it for half an hour, grab a colleague, she immediately points to it ) Fa

Odd behavior with 'currval'

2018-02-08 Thread Steven Hirsch
I have a body of code using JDBC to work with a PostgreSQL 9.6 database. All tables use 'SERIAL' or 'BIGSERIAL' types to generate ids. All are working correctly in terms of using the next value as a default. However, reading back the most recently applied (currval) value is failing for one tab