[GENERAL] PostgreSQL ODBC driver for OSX 10.8

2016-12-01 Thread Igor Korot
Hi, ALL, This is my first post here. I have actually 2 questions which are kind of related. 1. Is there an OSX version of the ODBC PostgreSQL driver? 1a. If there is none - is there an instructions on how to build and install it? 2. Is PostgreSQL ODBC driver works with iODBC? Thank you. -- Se

Re: [GENERAL] PostgreSQL ODBC driver for OSX 10.8

2016-12-01 Thread Igor Korot
Adrian, On Thu, Dec 1, 2016 at 11:37 AM, Adrian Klaver wrote: > On 12/01/2016 08:01 AM, Igor Korot wrote: >> >> Hi, ALL, >> This is my first post here. >> I have actually 2 questions which are kind of related. >> >> 1. Is there an OSX version of the ODB

Re: [GENERAL] PostgreSQL ODBC driver for OSX 10.8

2016-12-01 Thread Igor Korot
e] Thank you. On Thu, Dec 1, 2016 at 12:01 PM, Adrian Klaver wrote: > On 12/01/2016 08:41 AM, Igor Korot wrote: >> >> Adrian, >> >> On Thu, Dec 1, 2016 at 11:37 AM, Adrian Klaver >> wrote: >>> >>> On 12/01/2016 08:01 AM, Igor Korot wrote: >&

Re: [GENERAL] PostgreSQL ODBC driver for OSX 10.8

2016-12-01 Thread Igor Korot
Hi, Adrian, On Thu, Dec 1, 2016 at 7:30 PM, Adrian Klaver wrote: > On 12/01/2016 04:21 PM, Igor Korot wrote: >> >> Hi, guys, >> I downloaded the latest sources, but the configure failed. >> I have OSX 10.8 here. >> >> Which version of the driver is compa

[GENERAL] Importing SQLite database

2016-12-08 Thread Igor Korot
Hi, ALL, I have a text file which I got from exporting the SQLite database. The file contains an SQL statement which will generate the database. Excerpt from this file: [code] CREATE TABLE leagues( id INTEGER AUTOINCREMENT PRIMARY KEY, name VARCHAR(100),balance DOUBLE(10,2)); CREATE TABLE player

Re: [GENERAL] Importing SQLite database

2016-12-08 Thread Igor Korot
Adrian, On Thu, Dec 8, 2016 at 9:47 AM, Adrian Klaver wrote: > On 12/08/2016 04:54 AM, Igor Korot wrote: >> >> Hi, ALL, >> I have a text file which I got from exporting the SQLite database. >> >> The file contains an SQL statement which will generate the

Re: [GENERAL] Importing SQLite database

2016-12-08 Thread Igor Korot
Adrian, On Thu, Dec 8, 2016 at 9:54 AM, Igor Korot wrote: > Adrian, > > On Thu, Dec 8, 2016 at 9:47 AM, Adrian Klaver > wrote: >> On 12/08/2016 04:54 AM, Igor Korot wrote: >>> >>> Hi, ALL, >>> I have a text file which I got from exporting the SQLi

Re: [GENERAL] Importing SQLite database

2016-12-08 Thread Igor Korot
Hi, guys, On Thu, Dec 8, 2016 at 10:19 AM, Charles Clavadetscher wrote: > Hello > >> -Original Message- >> From: pgsql-general-ow...@postgresql.org >> [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Adrian Klaver >> Sent: Donnerstag, 8. Dezembe

Re: [GENERAL] Importing SQLite database

2016-12-10 Thread Igor Korot
https://www.postgresql.org/docs/9.5/static/datatype-numeric.html, I don't see a 'boolean' as supported data type. Any idea what is the problem? Thank you. P.S.: Sorry for the top-post. On Thu, Dec 8, 2016 at 10:14 PM, Tom Lane wrote: > Adrian Klaver writes: >>

Re: [GENERAL] Importing SQLite database

2016-12-10 Thread Igor Korot
Hi, On Sat, Dec 10, 2016 at 2:50 PM, John R Pierce wrote: > On 12/10/2016 11:32 AM, Igor Korot wrote: >> >> Looking >> athttps://www.postgresql.org/docs/9.5/static/datatype-numeric.html, >> I don't see a 'boolean' as supported data type. > > &g

Re: [GENERAL] Importing SQLite database

2016-12-10 Thread Igor Korot
Thank you Adrian. That was it. Now I can continue testing. On Sat, Dec 10, 2016 at 11:26 PM, Adrian Klaver wrote: > On 12/10/2016 06:56 PM, Igor Korot wrote: >> >> Hi, >> >> On Sat, Dec 10, 2016 at 2:50 PM, John R Pierce >> wrote: >>> &g

[GENERAL] Compatibility of libpg

2017-05-01 Thread Igor Korot
Hi, I just downloaded a latest (9.6.2) version of libpg. I am wondering - what is the lowest version of PostgreSQL it will be able to connect? Also - I want to create a project inside my MSVC 2010 solution and compile. Is there anything I need besides src/include and src/interface/libpg? Thank y

Re: [GENERAL] Compatibility of libpg

2017-05-01 Thread Igor Korot
Hi, Jihn, On Mon, May 1, 2017 at 6:33 PM, John R Pierce wrote: > On 5/1/2017 3:08 PM, Igor Korot wrote: >> >> Also - I want to create a project inside my MSVC 2010 solution and >> compile. >> Is there anything I need besides src/include and src/interface/libpg? >

Re: [GENERAL] Compatibility of libpg

2017-05-01 Thread Igor Korot
Hi, John, On May 1, 2017 8:00 PM, "John R Pierce" wrote: On 5/1/2017 4:28 PM, Igor Korot wrote: > Like I said, I don't have dll, I downloaded a source files and would > like to compile > the code myself from the MSVC. > > And I will use libpg calls directly.

Re: [GENERAL] Compatibility of libpg

2017-05-01 Thread Igor Korot
John, On Mon, May 1, 2017 at 9:38 PM, John R Pierce wrote: > On 5/1/2017 5:44 PM, Igor Korot wrote: >> >> >> But I want to build from MSVC. I already have a solution for it. All I >> need is to create a project inside that solution which will build the dll >>

Re: [GENERAL] Compatibility of libpg

2017-05-03 Thread Igor Korot
Hi, Magnus, On Wed, May 3, 2017 at 5:20 PM, Magnus Hagander wrote: > On Tue, May 2, 2017 at 4:49 AM, Igor Korot wrote: >> >> John, >> >> On Mon, May 1, 2017 at 9:38 PM, John R Pierce wrote: >> > On 5/1/2017 5:44 PM, Igor Korot wrote: >> >> >

[GENERAL] PQerrorMessage documentation

2017-05-03 Thread Igor Korot
Hi, ALL, [quote] Nearly all libpq functions will set a message for PQerrorMessage if they fail. Note that by libpq convention, a nonempty PQerrorMessage result can consist of multiple lines, and will include a trailing newline. The caller should not free the result directly. It will be freed when t

[GENERAL] Column information

2017-05-03 Thread Igor Korot
Hi, ALL, One more question if I may. [code] draft=# SELECT * FROM information_schema.columns WHERE table_name = 'leagues' AND ordinal_position = 8; table_catalog | table_schema | table_name | column_name | ordinal_position | column_default | is_nullable | data_type | character_maximum_length | c

Re: [GENERAL] Column information

2017-05-04 Thread Igor Korot
Hi, Alan, On Thu, May 4, 2017 at 3:18 AM, Alban Hertroys wrote: > >> According to the documentation 'numeric_precision_radix' field should >> indicate what radix the value of 'numeric_precision' is stored. >> >> However, even though the radix is 2, the actual value is 32, which is >> not a radix

Re: [GENERAL] Column information

2017-05-04 Thread Igor Korot
Hi, guys, On Thu, May 4, 2017 at 10:54 AM, Adrian Klaver wrote: > On 05/04/2017 07:44 AM, Tom Lane wrote: >> >> Adrian Klaver writes: >>> >>> Alright I see that, but why does my example show a >>> numeric_precision_radix of 10? >> >> >>> Is there some transition point where it goes from base 10

Re: [GENERAL] Column information

2017-05-04 Thread Igor Korot
David et al, On Thu, May 4, 2017 at 11:27 AM, David G. Johnston wrote: > On Thu, May 4, 2017 at 8:08 AM, Igor Korot wrote: >> >> Hi, guys, >> >> On Thu, May 4, 2017 at 10:54 AM, Adrian Klaver >> wrote: >> > On 05/04/2017 07:44 AM, Tom Lan

[GENERAL] Link errors

2017-05-04 Thread Igor Korot
Hi, [code] 1> Creating library vc_mswuddll\postgres_dll.lib and object vc_mswuddll\postgres_dll.exp 1>libpqd.lib(fe-connect.obj) : error LNK2019: unresolved external symbol __imp__WSAIoctl@36 referenced in function _setKeepalivesWin32 1>libpqd.lib(ip.obj) : error LNK2001: unresolved external sy

Re: [GENERAL] PQerrorMessage documentation

2017-05-04 Thread Igor Korot
Hi, On Thu, May 4, 2017 at 9:57 PM, Peter Eisentraut wrote: > On 5/3/17 21:23, Igor Korot wrote: >> Hi, ALL, >> [quote] >> Nearly all libpq functions will set a message for PQerrorMessage if >> they fail. Note that by libpq convention, a nonempty PQerrorMessage >&g

[GENERAL] Where is the libpg on OSX?

2017-05-04 Thread Igor Korot
Hi, ALL, [code] Igors-MacBook-Air:/ igorkorot$ find . -name *libpg* find: ./.DocumentRevisions-V100: Permission denied find: ./.fseventsd: Permission denied find: ./.Spotlight-V100: Permission denied find: ./.Trashes: Permission denied ./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.p

[GENERAL] Where is the error?

2017-05-06 Thread Igor Korot
Hi, ALL, I am trying to execute following piece of code: [code] std::string query1 = "DECLARE alltables CURSOR SELECT table_schema, table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' OR table_type = 'VIEW' OR table_type = 'LOCAL TEMPORARY';"; res = PQexec( m_db, quer

Re: [GENERAL] Where is the error?

2017-05-06 Thread Igor Korot
Hi, Christoph, On May 6, 2017 2:24 PM, "Christoph Moench-Tegeder" wrote: ## Igor Korot (ikoro...@gmail.com): > std::string query1 = "DECLARE alltables CURSOR SELECT > table_schema, table_name FROM information_schema.tables WHERE > table_type = 'BASE TAB

[GENERAL] Sample in documentation

2017-05-06 Thread Igor Korot
Hi, ALL, I tried to implement the code found in https://www.postgresql.org/docs/current/static/libpq-example.html. On Windows with MSVC 2010 and Liniux with gcc-5.4 it compiled fine. However on OSX 10.8 with: [code] Igors-MacBook-Air:dbhandler igorkorot$ gcc --version Configured with: --prefix=/

Re: [GENERAL] Sample in documentation

2017-05-06 Thread Igor Korot
Hi, Tom, On Sat, May 6, 2017 at 8:22 PM, Tom Lane wrote: > Igor Korot writes: >> I tried to implement the code found in >> https://www.postgresql.org/docs/current/static/libpq-example.html. >> ... >> I am getting an error: >> [quote] >> Non-constant-

[GENERAL]

2017-05-06 Thread Igor Korot
Hi, I'm trying to retrieve an information about the table. Query is below: SELECT cols.column_name, cols.data_type, cols.character_maximum_length, cols.character_octet_length, cols.numeric_precision, cols.numeric_precision_radix, cols.numeric_scale, cols,column_default, cols.is_nullable, table_con

Re: [GENERAL]

2017-05-07 Thread Igor Korot
Andreas, On Sun, May 7, 2017 at 6:02 AM, Andreas Kretschmer wrote: > Igor Korot wrote: > >> Hi, >> I'm trying to retrieve an information about the table. Query is below: >> >> SELECT cols.column_name, cols.data_type, >> cols.character_ma

Re: [GENERAL]

2017-05-07 Thread Igor Korot
David, On Sun, May 7, 2017 at 7:57 AM, David Rowley wrote: > On 7 May 2017 at 16:43, Igor Korot wrote: >> I'm trying to retrieve an information about the table. Query is below: >> >> SELECT cols.column_name, cols.data_type, >> cols.character_maximum_len

Re: [GENERAL] Sample in documentation

2017-05-07 Thread Igor Korot
Tom et al, On Sun, May 7, 2017 at 1:09 PM, Tom Lane wrote: > Igor Korot writes: >> On Sat, May 6, 2017 at 8:22 PM, Tom Lane wrote: >>> I do not see any arrays named "length", nor even any arrays of size 2, >>> on that page, so I'm pretty confused what

Re: [GENERAL]

2017-05-07 Thread Igor Korot
David, On Sun, May 7, 2017 at 8:57 AM, David Rowley wrote: > On 8 May 2017 at 00:42, Igor Korot wrote: >> Basically what I'd like to see is the definition of each column and >> whether this column is >> part of primary/foreign key or not. > > information_schema.t

Re: [GENERAL]

2017-05-10 Thread Igor Korot
Hi, guys, On Sun, May 7, 2017 at 1:40 PM, Igor Korot wrote: > David, > > On Sun, May 7, 2017 at 8:57 AM, David Rowley > wrote: >> On 8 May 2017 at 00:42, Igor Korot wrote: >>> Basically what I'd like to see is the definition of each column and >>> w

Re: [GENERAL]

2017-05-10 Thread Igor Korot
Hi, John et al, On Wed, May 10, 2017 at 11:02 PM, John R Pierce wrote: > On 5/10/2017 7:45 PM, Igor Korot wrote: >> >> I found >> this:https://wiki.postgresql.org/wiki/Retrieve_primary_key_columns, >> but now I need >> to connect this with information_schema.colu

Re: [GENERAL]

2017-05-11 Thread Igor Korot
Melvin et al, On Thu, May 11, 2017 at 8:50 AM, Melvin Davidson wrote: > > On Wed, May 10, 2017 at 11:26 PM, Igor Korot wrote: > >> Hi, John et al, >> >> On Wed, May 10, 2017 at 11:02 PM, John R Pierce >> wrote: >> > On 5/10/2017 7:45 PM, Igor Korot w

Re: [GENERAL]

2017-05-11 Thread Igor Korot
Adrian et al, On Thu, May 11, 2017 at 9:54 AM, Adrian Klaver wrote: > On 05/11/2017 06:24 AM, Igor Korot wrote: >> >> Melvin et al, >> > >> >> Now are you saying that the information about the fields in the table can >> be retrieved from >> s

[GENERAL] libpg sources

2017-05-23 Thread Igor Korot
Hi, ALL, Can I put libpg sources into my project? Or I will have to provide binaries? Thank you. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] libpg sources

2017-05-23 Thread Igor Korot
On Tue, May 23, 2017 at 10:54 AM, John McKown wrote: > On Tue, May 23, 2017 at 9:39 AM, Albe Laurenz > wrote: >> >> Igor Korot wrote: >> >> > Can I put libpg sources into my project? Or I will have to provide >> > binaries? >> >> You can do a

[GENERAL] Have just libpg installer

2017-05-23 Thread Igor Korot
Hi, ALL, Is it possible to have just libpg installer for main OSes: Win, Linux, Mac? And then just the source code of the client library to compile, since I don't have latest OSX available? Thank you. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Have just libpg installer

2017-05-23 Thread Igor Korot
Adrian, On Tue, May 23, 2017 at 5:52 PM, Adrian Klaver wrote: > On 05/23/2017 09:12 AM, Igor Korot wrote: >> >> Hi, ALL, >> Is it possible to have just libpg installer for main OSes: Win, Linux, >> Mac? > > > AFAIK there is no libpg library. I going to

Re: [GENERAL] Have just libpg installer

2017-05-23 Thread Igor Korot
Adrian, On Tue, May 23, 2017 at 7:28 PM, Adrian Klaver wrote: > On 05/23/2017 04:15 PM, Igor Korot wrote: >> >> Adrian, >> >> On Tue, May 23, 2017 at 5:52 PM, Adrian Klaver >> wrote: >>> >>> On 05/23/2017 09:12 AM, Igor Korot wrote: >>>

Re: [GENERAL] Have just libpg installer

2017-05-23 Thread Igor Korot
Adrian, On Tue, May 23, 2017 at 10:45 PM, Igor Korot wrote: > Adrian, > > On Tue, May 23, 2017 at 7:28 PM, Adrian Klaver > wrote: >> On 05/23/2017 04:15 PM, Igor Korot wrote: >>> >>> Adrian, >>> >>> On Tue, May 23, 2017 at 5:52 PM, Adri

Re: [GENERAL] Have just libpg installer

2017-05-24 Thread Igor Korot
Adrian, On Wed, May 24, 2017 at 12:09 AM, Adrian Klaver wrote: > On 05/23/2017 08:03 PM, Igor Korot wrote: >> >> Adrian, >> >> On Tue, May 23, 2017 at 10:45 PM, Igor Korot wrote: >>> >>> Adrian, >>> >>> On Tue, May 23, 2017 at 7:28

Re: [GENERAL] Have just libpg installer

2017-05-24 Thread Igor Korot
On Wed, May 24, 2017 at 10:14 AM, Adrian Klaver wrote: > On 05/24/2017 06:58 AM, Igor Korot wrote: >> >> Adrian, >> >> On Wed, May 24, 2017 at 12:09 AM, Adrian Klaver >> wrote: > > > >>> It would help to know what you plan to do with the

Re: [GENERAL] Have just libpg installer

2017-05-24 Thread Igor Korot
New thread created. Thank you. On Wed, May 24, 2017 at 10:24 AM, Adrian Klaver wrote: > On 05/24/2017 07:18 AM, Igor Korot wrote: >> >> On Wed, May 24, 2017 at 10:14 AM, Adrian Klaver >> wrote: >>> >>> On 05/24/2017 06:58 AM, Igor Korot wrote: >>

[GENERAL] libpq Windows Debug binaries

2017-05-24 Thread Igor Korot
Hi, ALL, Does anybody have a ready-to-use solution for libpq binaries for the Debug build on Windows? Thank you. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Connection options

2017-06-15 Thread Igor Korot
Hi, ALL, I'm looking at the documentation at www.postgresql.org/docs/current/static/libpq-connect.html section 32.1.2. The part for "option" reads: [quote] Specifies command-line options to send to the server... [/quote] Does this mean that if I'm writing a C/C++ program, I shouldn't care about

Re: [GENERAL] Connection options

2017-06-15 Thread Igor Korot
Hi, again, On Thu, Jun 15, 2017 at 2:59 PM, Igor Korot wrote: > Hi, ALL, > I'm looking at the documentation at > www.postgresql.org/docs/current/static/libpq-connect.html > section 32.1.2. > > The part for "option" reads: > > [quote] > Specifies

Re: [GENERAL] Connection options

2017-06-15 Thread Igor Korot
Hi, Adrian, On Thu, Jun 15, 2017 at 4:13 PM, Adrian Klaver wrote: > On 06/15/2017 12:02 PM, Igor Korot wrote: >> >> Hi, again, >> >> On Thu, Jun 15, 2017 at 2:59 PM, Igor Korot wrote: >>> >>> Hi, ALL, >>> I'm looking at the docume

Re: [GENERAL] Connection options

2017-06-15 Thread Igor Korot
Hi, David, On Thu, Jun 15, 2017 at 4:46 PM, David G. Johnston wrote: > On Thu, Jun 15, 2017 at 1:23 PM, Igor Korot wrote: >> >> And could you clarify on the first part of this? >> From the quote I poste it sounds like this is available only in >> command-line >&g

[GENERAL] Remote connection to PostgreSQL

2017-06-19 Thread Igor Korot
Hi, ALL, Is there some magic in order to turn on remote connection to PostgreSQL? There are some extra steps to turn it on for MS SQL and MySQL, so I figured it should be the same for Postgre. Thank you. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] Remote connection to PostgreSQL

2017-06-19 Thread Igor Korot
Thx, David. On Mon, Jun 19, 2017 at 12:09 PM, David G. Johnston wrote: > On Mon, Jun 19, 2017 at 9:02 AM, Igor Korot wrote: >> >> Hi, ALL, >> Is there some magic in order to turn on remote connection to PostgreSQL? >> >> There are some extra steps to turn

[GENERAL] Get table OID

2017-07-13 Thread Igor Korot
Hi, ALL, Is it possible to get the table ID (or OID) from information_schema somewhere? Thank you. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL]

2017-07-19 Thread Igor Korot
Hi, ALL On Thu, May 11, 2017 at 6:47 PM, Adrian Klaver wrote: > On 05/11/2017 07:26 AM, Igor Korot wrote: >> >> Adrian et al, >> >> On Thu, May 11, 2017 at 9:54 AM, Adrian Klaver >> wrote: >>> >>> On 05/11/2017 06:24 AM, Igor Korot wrote: >

[GENERAL] Backward compatibility

2017-07-20 Thread Igor Korot
Hi, ALL, According to the documentation PostgreSQL 9.6 (latest) supports CREATE INDEX IF NOT EXIST However, the version 9.4 and below supports only CREATE INDEX. Is there a query or a libpg function which can return the version of the server I'm running? And in the latter case - is there a way

Re: [GENERAL] Backward compatibility

2017-07-20 Thread Igor Korot
Hi, guys, On Thu, Jul 20, 2017 at 10:19 PM, Andreas Kretschmer wrote: > On 21 July 2017 04:13:47 GMT+02:00, Igor Korot wrote: >>Hi, ALL, >>According to the documentation PostgreSQL 9.6 (latest) supports >> >>CREATE INDEX IF NOT EXIST >> >>However,

Re: [GENERAL] Backward compatibility

2017-07-20 Thread Igor Korot
Hi, David, On Thu, Jul 20, 2017 at 10:23 PM, David G. Johnston wrote: > On Thu, Jul 20, 2017 at 7:13 PM, Igor Korot wrote: >> >> Hi, ALL, >> According to the documentation PostgreSQL 9.6 (latest) supports >> >> CREATE INDEX IF NOT EXIST >> >> How

Re: [GENERAL] Backward compatibility

2017-07-20 Thread Igor Korot
ALso, I presume there is no special libpg function, right? Thank you. On Thu, Jul 20, 2017 at 10:44 PM, Igor Korot wrote: > Hi, David, > > On Thu, Jul 20, 2017 at 10:23 PM, David G. Johnston > wrote: >> On Thu, Jul 20, 2017 at 7:13 PM, Igor Korot wrote: >>> >&g

Re: [GENERAL] Backward compatibility

2017-07-21 Thread Igor Korot
Hi, guys, On Thu, Jul 20, 2017 at 11:58 PM, Tom Lane wrote: > John R Pierce writes: >> On 7/20/2017 8:40 PM, Tom Lane wrote: >>> Hm, we need to update that text for the new 2-part version numbering >>> scheme, don't we? > >> will 10 return like 100100 if its 10.1, or 11 ? > > The latter. Th

Re: [GENERAL] Backward compatibility

2017-07-21 Thread Igor Korot
David et al, On Fri, Jul 21, 2017 at 12:00 PM, David G. Johnston wrote: > On Fri, Jul 21, 2017 at 8:49 AM, Igor Korot wrote: >> >> MySQL uses this: >> https://dev.mysql.com/doc/refman/5.7/en/mysql-get-server-version.html. >> Is it safe to assume that PostgreSQL calc

Re: [GENERAL] Backward compatibility

2017-07-21 Thread Igor Korot
Hi, guys, Below query does not even run: SELECT version(), substring( version() from position( '\s' in version() ) ); Could you spot the error? On Fri, Jul 21, 2017 at 12:11 PM, Igor Korot wrote: > David et al, > > On Fri, Jul 21, 2017 at 12:00 PM, David G. Johnston > wr

Re: [GENERAL] Backward compatibility

2017-07-22 Thread Igor Korot
Hi, John, On Sat, Jul 22, 2017 at 8:44 AM, John McKown wrote: > On Fri, Jul 21, 2017 at 10:21 PM, Igor Korot wrote: >> >> Hi, guys, >> Below query does not even run: >> >> SELECT version(), substring( version() from position( '\s' in versi

Re: [GENERAL] Backward compatibility

2017-07-22 Thread Igor Korot
Thx. The split_part() works perfectly. On Sat, Jul 22, 2017 at 10:49 AM, Tom Lane wrote: > Igor Korot writes: >> But it works incorrectly - it should return: >> 9.5.7 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 6.3.1 20161221 >> (Red Hat 6.3.1-1), 64-bit >

[GENERAL] What is the problem with this query?

2017-07-23 Thread Igor Korot
Hi, ALL, draft=# IF NOT EXISTS( SELECT 1 FROM pg_class c, pg_namespace n WHERE n.oid = c.relnamespace AND c.relname = 'abcattbl_tnam_ownr' AND n.nspname = 'public' ) THEN CREATE INDEX "abcattbl_tnam_ownr" ON "abcattbl"("abt_tnam" ASC, "abt_ownr" ASC); ERROR: syntax error at or near "IF" LINE 1: I

Re: [GENERAL] What is the problem with this query?

2017-07-23 Thread Igor Korot
Hi, David, On Sun, Jul 23, 2017 at 5:07 PM, David G. Johnston wrote: > On Sunday, July 23, 2017, Igor Korot wrote: >> >> Is "IF" operator not supported by PostgreSQL So how do I write this properly? Thank you. > > > IF is pl/pgsql, not SQL. > > David

Re: [GENERAL] What is the problem with this query?

2017-07-23 Thread Igor Korot
Hi, Christoph, On Sun, Jul 23, 2017 at 5:30 PM, Christoph Moench-Tegeder wrote: > ## Igor Korot (ikoro...@gmail.com): > >> >> Is "IF" operator not supported by PostgreSQL >> So how do I write this properly? > > There is documentation for that: > https:/

[GENERAL] ODBC driver issue

2017-07-26 Thread Igor Korot
Hi, I'm testing my program and got an interesting issue. I have an OSX 10.8 with iODBC manager and PostgreSQL ODBC driver. When I tried to query the database table with the column "char(129)" I get: "My field text" (the text with the bunch of spaces at the end). The dri

Re: [GENERAL] ODBC driver issue

2017-07-26 Thread Igor Korot
Hi, John, On Wed, Jul 26, 2017 at 11:08 PM, John R Pierce wrote: > On 7/26/2017 7:25 PM, Igor Korot wrote: >> >> When I tried to query the database table with the column "char(129)" I >> get: >> >> "My field text" >> >> (the text

[GENERAL] Why am I getting doubles?

2017-07-27 Thread Igor Korot
Hi, The query below should get foreign keys for a specific table: draft=# SELECT DISTINCT kcu.ordinal_position AS ordinal, kcu.position_in_unique_constraint AS position, tc.constraint_name AS name, tc.constraint_schema AS schema, tc.table_name AS table, kcu.column_name AS column, ccu.table_name AS

[GENERAL] Invalid byte sequence for encoding UTF-8 0xc3\n

2017-07-30 Thread Igor Korot
Hi, ALL, I am using a database for my project that I created inside SQLite3. This database contains a table called "abc" (it is "abc" + symbol with the code 225 - greek letter "beta or a German symbol for "ss"). All I did was to export that database into the text file and then imported this file i

Re: [GENERAL] Invalid byte sequence for encoding UTF-8 0xc3\n

2017-07-30 Thread Igor Korot
Hi, John, On Sun, Jul 30, 2017 at 4:34 PM, John R Pierce wrote: > On 7/30/2017 1:19 PM, Igor Korot wrote: >> >> I am using a database for my project that I created inside SQLite3. >> This database contains a table called "abc" (it is "abc" + >> symb

Re: [GENERAL] Invalid byte sequence for encoding UTF-8 0xc3\n

2017-07-30 Thread Igor Korot
Hi, John, On Sun, Jul 30, 2017 at 4:53 PM, John R Pierce wrote: > On 7/30/2017 1:43 PM, Igor Korot wrote: > > what encodings are default on your system ?`\l+` in psql should show the > encodings. > > Is this "backslash + pipe + plus-sign"? > >

Re: [GENERAL] Invalid byte sequence for encoding UTF-8 0xc3\n

2017-07-30 Thread Igor Korot
John, On Sun, Jul 30, 2017 at 5:32 PM, Igor Korot wrote: > Hi, John, > > On Sun, Jul 30, 2017 at 4:53 PM, John R Pierce wrote: >> On 7/30/2017 1:43 PM, Igor Korot wrote: >> >> what encodings are default on your system ?`\l+` in psql should show the >> en

[GENERAL] Check if prepared statement exist?

2017-08-03 Thread Igor Korot
Hi, ALL, Is there a way to do such a check from the libpq? I'm trying to call a function from 2 different places of the application and want to see if I already had the call to PQprepare(); Thank you. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to you

[GENERAL] Lifetime of PQexecPrepared() returned value

2017-08-04 Thread Igor Korot
Hi, ALL, I have a following piece of code: [code] PGresult *res = PQexecPrepared(); status = PQresultStatue( res ); if( status == PGRES_TUPLES_OK ) { for( int j = 0; j < PQntuples( res ); j++ ) { char *foo = PQgetValue( res, j, 0 ); char *bar = PQgetValue( res, j, 1 );

Re: [GENERAL] Lifetime of PQexecPrepared() returned value

2017-08-04 Thread Igor Korot
Hi, Michael, On Fri, Aug 4, 2017 at 3:26 PM, Michael Paquier wrote: > On Fri, Aug 4, 2017 at 9:12 PM, Igor Korot wrote: >> Am I missing something? How do I fix the crash? > > Based on what I can see here, I see nothing wrong. Now it is hard to > reach any conclusion with the l

Re: [GENERAL] Lifetime of PQexecPrepared() returned value

2017-08-05 Thread Igor Korot
Hi, guys, On Fri, Aug 4, 2017 at 5:01 PM, Tom Lane wrote: > Igor Korot writes: >> I have a following piece of code: > >> [code] >> PGresult *res = PQexecPrepared(); >> status = PQresultStatue( res ); >> if( status == PGRES_TUPLES_OK ) >> { >

Re: [GENERAL] Invalid byte sequence for encoding UTF-8 0xc3\n

2017-08-05 Thread Igor Korot
John et al, On Mon, Jul 31, 2017 at 12:13 AM, Igor Korot wrote: > John, > > On Sun, Jul 30, 2017 at 5:32 PM, Igor Korot wrote: >> Hi, John, >> >> On Sun, Jul 30, 2017 at 4:53 PM, John R Pierce wrote: >>> On 7/30/2017 1:43 PM, Igor Korot wrote: >>>

Re: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys (serials)

2017-08-05 Thread Igor Korot
Hi, Did you try bringing it to SAP? Thank you. On Sat, Aug 5, 2017 at 2:39 PM, Dan Cooperstock at Software4Nonprofits wrote: > Yes my direct SQL testing used all caps and worked fine. > > There is no error message. It's just that PowerBuilder's built-in mechanism > that should retrieve the ide

Re: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys (serials)

2017-08-05 Thread Igor Korot
Hi, Dan, On Sat, Aug 5, 2017 at 8:52 PM, Dan Cooperstock at Software4Nonprofits wrote: > No, Carl, when I created the sequence, I didn't put its name in double > quotes, so therefore its name wasn't being forced to stay upper case. So in > the nextval() command, putting it only in single quotes w

[GENERAL] Compiling libpq only on Linux

2017-08-08 Thread Igor Korot
Hi, ALL, Quick question - what is the best way to compile libpq only on Linux? I just checked and currently my distro (I didn't updated in a long time) has 9.5 version as current. Should I grab it, unpack it and do configure and then make inside libpq directory manually? Or there is some other

[GENERAL] Where is pg_hba.conf

2017-08-13 Thread Igor Korot
Hi, I have a Mac with OSX 10.8 installed. It has Postgre 9.1. According to https://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html and http://www.thegeekstuff.com/2014/02/enable-remote-postgresql-connection/?utm_source=tuicool I need to modify the pg_hba.conf file to get access to the DB

Re: [GENERAL] Where is pg_hba.conf

2017-08-13 Thread Igor Korot
Hi, Christoph, On Sun, Aug 13, 2017 at 10:09 AM, Christoph Berg wrote: > Re: Igor Korot 2017-08-13 > >> I need to modify the pg_hba.conf file to get access to the DB >> remotely. >> >> However, I can't find this file anywhere on the system. > > Try &qu

Re: [GENERAL] Where is pg_hba.conf

2017-08-13 Thread Igor Korot
"root" only? Thank you. > > Hope this helps > > > > On Aug 13, 2017, at 9:00 AM, Igor Korot wrote: > > Hi, > I have a Mac with OSX 10.8 installed. It has Postgre 9.1. > According to > https://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html > and > h

Re: [GENERAL] Where is pg_hba.conf

2017-08-13 Thread Igor Korot
ank you. On Sun, Aug 13, 2017 at 10:37 AM, Christoph Berg wrote: > Re: Igor Korot 2017-08-13 > >> draft=# SHOW hba_file >> draft-# SHOW hba_file; >> ERROR: syntax error at or near "SHOW" >> LINE 2: SHOW hba_file; >> ^ > > Stan

Re: [GENERAL] Where is pg_hba.conf

2017-08-13 Thread Igor Korot
Also, I presume that the address in this file is the address of the machine where the server is located, not the address from where the connection is initiated. On Sun, Aug 13, 2017 at 10:53 AM, Igor Korot wrote: > Hi, > OK, I found it under the root account. > > Now I am mod

[GENERAL] Results interpretation

2017-08-18 Thread Igor Korot
Hi, I looked at the documentation, but couldn't find it. If I do PQexec() call, the results will be interpreted as binary or text? I'm trying to get an int field from the query and wonder if I need to do hton() call or not? Thank you. -- Sent via pgsql-general mailing list (pgsql-general@pos

Re: [GENERAL] Results interpretation

2017-08-18 Thread Igor Korot
ng? I.e. no ntoh() call? Thank you. > > > > -- > Vincenzo Romano - NotOrAnd.IT > Information Technologies > -- > NON QVIETIS MARIBVS NAVTA PERITVS > > Il 18 ago 2017 19:46, "Igor Korot" ha scritto: >> >> Hi, >> I looked at the documentati

Re: [GENERAL] Results interpretation

2017-08-18 Thread Igor Korot
ion Technologies > -- > NON QVIETIS MARIBVS NAVTA PERITVS > > Il 18 ago 2017 20:45, "Igor Korot" ha scritto: >> >> Hi, Vincenzo, >> >> On Fri, Aug 18, 2017 at 1:51 PM, Vincenzo Romano >> wrote: >> > Afaik, pgresult structure and it's

Re: [GENERAL] Results interpretation

2017-08-19 Thread Igor Korot
Hi, Daniel, On Sat, Aug 19, 2017 at 12:51 PM, Daniel Verite wrote: > Igor Korot wrote: > >> If I do PQexec() call, the results will be interpreted as binary or text? >> >> I'm trying to get an int field from the query and wonder if I need to do >>

[GENERAL] What is the proper query

2017-08-21 Thread Igor Korot
Hi, ALL, draft=# SELECT * FROM information_schema.key_column_usage WHERE table_schema = 'public' AND table_name = 'leaguescorehitter'; constraint_catalog | constraint_schema |constraint_name | table_catalog | table_schema |table_name | column_name | ordinal_position | position_in

Re: [GENERAL] What is the proper query

2017-08-22 Thread Igor Korot
Or this is the bug in 9.1? Since it looks like there are 2 columns with the same info in 1 table/view Thank you. On Tue, Aug 22, 2017 at 12:08 AM, Igor Korot wrote: > Hi, ALL, > draft=# SELECT * FROM information_schema.key_column_usage WHERE > table_schema = 'public&#

Re: [GENERAL] What is the proper query

2017-08-22 Thread Igor Korot
Hi, David, On Tue, Aug 22, 2017 at 12:06 PM, David G. Johnston wrote: > On Tue, Aug 22, 2017 at 8:43 AM, Igor Korot wrote: >> >> Or this is the bug in 9.1? >> Since it looks like there are 2 columns with the same info in 1 >> table/view > > > This old ema

Re: [GENERAL] What is the proper query

2017-08-22 Thread Igor Korot
raint_name AND x.table_schema = $1 AND x.table_name = $2 order by c.constraint_name, x.ordinal_position; Then in my C++ code: std::map >; foreign_keys[pos].push_back( new FKField( field_pos, name, column, ref_schema, ref_table, ref_column, update_rule, delete_rule ) ); This is my target. Th

[GENERAL] Retrieving query results

2017-08-22 Thread Igor Korot
Hi, ALL, [quote] PQntuples Returns the number of rows (tuples) in the query result. Because it returns an integer result, large result sets might overflow the return value on 32-bit operating systems. int PQntuples(const PGresult *res); [/quote] Is there another way to not to overflow the resu

Re: [GENERAL] What is the proper query

2017-08-22 Thread Igor Korot
NE 1|0|playersinleague|id|id|NO ACTION|NO ACTION|NONE 1|1|playersinleague|playerid|playerid|NO ACTION|NO ACTION|NONE 2|0|leagues|id|id|NO ACTION|NO ACTION|NONE Can I get something from PostgreSQL? Thank you. > > On Tue, Aug 22, 2017 at 12:42 PM, Igor Korot wrote: > >> Hi, David, >&g

Re: [GENERAL] Retrieving query results

2017-08-22 Thread Igor Korot
Hi, Michael, On Tue, Aug 22, 2017 at 8:32 PM, Michael Paquier wrote: > On Wed, Aug 23, 2017 at 3:19 AM, Igor Korot wrote: >> [quote] >> PQntuples >> >> Returns the number of rows (tuples) in the query result. Because it >> returns an integer result, large resu

Re: [GENERAL] What is the proper query

2017-08-23 Thread Igor Korot
Hi, On Tue, Aug 22, 2017 at 6:18 PM, Igor Korot wrote: > Melvin et al, > > On Tue, Aug 22, 2017 at 12:55 PM, Melvin Davidson > wrote: > >> >> >> >> *While the information_schema is useful, there is no substitute for >> learning how to use th

Re: [GENERAL] Retrieving query results

2017-08-24 Thread Igor Korot
Hi, guys, On Thu, Aug 24, 2017 at 8:51 AM, Tom Lane wrote: > Michael Paquier writes: >> On Wed, Aug 23, 2017 at 3:19 AM, Igor Korot wrote: >>> [quote] >>> PQntuples >>> >>> Returns the number of rows (tuples) in the query result. Because it >

  1   2   >