Re: [HACKERS] libpq connection status and closed fd

2014-09-22 Thread Dmitriy Igrishin
2014-09-22 12:36 GMT+04:00 Marko Tiikkaja : > On 9/22/14 9:45 AM, Dmitriy Igrishin wrote: > >> 2014-09-22 11:35 GMT+04:00 Daniele Varrazzo : >> >> On Mon, Sep 22, 2014 at 8:17 AM, Dmitriy Igrishin >>> wrote: >>> >>>> Why are you using c

Re: [HACKERS] libpq connection status and closed fd

2014-09-22 Thread Dmitriy Igrishin
2014-09-22 11:35 GMT+04:00 Daniele Varrazzo : > On Mon, Sep 22, 2014 at 8:17 AM, Dmitriy Igrishin > wrote: > > > > 2014-09-22 10:42 GMT+04:00 Daniele Varrazzo >: > > >> [2] https://gist.github.com/dvarrazzo/065f343c95f8ea67cf8f > > > >

Re: [HACKERS] libpq connection status and closed fd

2014-09-22 Thread Dmitriy Igrishin
2014-09-22 10:42 GMT+04:00 Daniele Varrazzo : > Hello, > > a psycopg user is reporting [1] that the library is not marking the > connection as closed and/or bad after certain errors, such as a > connection timeout. He is emulating the error by closing the > connection fd (I don't know if the two c

Re: [HACKERS] Millisecond-precision connect_timeout for libpq

2013-07-09 Thread Dmitriy Igrishin
2013/7/9 Merlin Moncure > On Fri, Jul 5, 2013 at 12:28 PM, ivan babrou wrote: > > Hi, guys! I made a quick patch to support floating number in > > connect_timeout param for libpq. This will treat floating number as > > seconds so this is backwards-compatible. I don't usually write in C, > > so t

Re: [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-21 Thread Dmitriy Igrishin
2013/6/21 Albe Laurenz > Dmitriy Igrishin wrote: > > Sent: Thursday, June 20, 2013 5:09 PM > > To: PostgreSQL Hackers > > Subject: [HACKERS] Frontend/backend protocol improvements proposal > (request). > > > > Hackers, > > > > While developing

[HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-20 Thread Dmitriy Igrishin
Hackers, While developing a C++ client library for Postgres I felt lack of extra information in command tags in the CommandComplete (B) message for the following commands: PREPARE; DEALLOCATE; DECLARE; CLOSE; LISTEN; UNLISTEN; SET; RESET. Namely, for example, users of my library ca

Re: [HACKERS] About large objects asynchronous and non-blocking support

2013-06-07 Thread Dmitriy Igrishin
2013/6/8 Giovanni Mascellani > Hi. > > Il 05/06/2013 22:52, Dmitriy Igrishin ha scritto: > >> At the moment libpq doesn't seem to support asynchronous and > >> non-blocking support for large objects, in the style of > >> PQsendQuery/PQgetResult. T

[HACKERS] Multiple error reports.

2013-06-06 Thread Dmitriy Igrishin
According to http://www.postgresql.org/docs/9.2/static/libpq-async.html "Even when PQresultStatus indicates a fatal error, PQgetResult should be called until it returns a null pointer, to allow libpq to process the error information completely." In libpq/fe-exec.c:PQexecFinish() error messages merg

Re: [HACKERS] About large objects asynchronous and non-blocking support

2013-06-06 Thread Dmitriy Igrishin
2013/6/6 Tatsuo Ishii > > Hi. > > > > At the moment libpq doesn't seem to support asynchronous and > > non-blocking support for large objects, in the style of > > PQsendQuery/PQgetResult. This makes large objects hardly suited for > > single-threaded programs based on some variant of select(). >

Re: [HACKERS] About large objects asynchronous and non-blocking support

2013-06-05 Thread Dmitriy Igrishin
2013/6/5 Giovanni Mascellani > Hi. > > At the moment libpq doesn't seem to support asynchronous and > non-blocking support for large objects, in the style of > PQsendQuery/PQgetResult. This makes large objects hardly suited for > single-threaded programs based on some variant of select(). > Accor

Re: [HACKERS] 9.3 Beta1 status report

2013-05-17 Thread Dmitriy Igrishin
2013/4/21 Bruce Momjian > I am not sure if Tom shared yet, but we are planning to package 9.3 > beta1 on April 29, with a release on May 2. Those dates might change, > but that is the current plan. I have completed a draft 9.3 release > notes, which you can view here: > > http://momjian

Re: [HACKERS] allowing multiple PQclear() calls

2013-01-02 Thread Dmitriy Igrishin
2013/1/2 Heikki Linnakangas > On 02.01.2013 17:27, Marko Kreen wrote: > >> On Wed, Jan 2, 2013 at 5:11 PM, Boszormenyi Zoltan >> wrote: >> >>> 2012-12-11 16:09 keltezéssel, Simon Riggs írta: >>> >>> On 11 December 2012 12:18, Boszormenyi Zoltan wrote: Such mechanism already exist -

Re: [HACKERS] missing semicolon at end of psql files

2012-09-12 Thread Dmitriy Igrishin
2012/9/12 Peter Eisentraut > I was surprised to find that psql -f file.sql with a file such as this > > select 1; > select 2 > > executes both commands even though the second one is not terminated. > > I realize that this is inconsistently handled throughout the system, for > example libpq APIs d

Re: [HACKERS] Bug in libpq implentation and omission in documentation?

2012-08-08 Thread Dmitriy Igrishin
Hey Jim, 2012/8/8 Jim Vanns > Hello PG hackers. Yesterday I began diagnosing a peculiar bug in some > production code that has been happily running for months. I finally got > to the bottom of it despite the rather misleading error message. Anyway, > within a section of code we are making a DELE

[HACKERS] unsigned and signed chars in libpq API

2012-02-01 Thread Dmitriy Igrishin
Hey all, Could you tell me please an objective reason why PQunescapeBytea() returns unsigned char* rather than just char* ? I am asking because a bit confused. How this intermixes with LO's API, which based on signed chars (although as we all know large object - is a just bytea splitted on chunks)

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Dmitriy Igrishin
2011/11/24 Alexander Shulgin > > Excerpts from Dmitriy Igrishin's message of Thu Nov 24 09:19:02 +0200 2011: > > > > > If host part of the URI points to localhost, the UNIX domain socket > would > > > be considered by libpq just as if you would pass "-h localhost -p > 5433". > > > > > But what if

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Dmitriy Igrishin
Hey Alexander, 2011/11/24 Alexander Shulgin > > Excerpts from Florian Weimer's message of Wed Nov 23 13:04:47 +0200 2011: > > > > * Alexander Shulgin: > > > > > This, in my opinion, is very similar to what we would like to achieve > with the URI syntax, so the above could also be specified using

Re: [HACKERS] fixing PQsetvalue()

2011-06-23 Thread Dmitriy Igrishin
2011/6/23 Andrew Chernow > you are creating as you iterate through. This behavior was >>unnecessary in terms of what libpqtypes and friends needed and may (as >>Tom suggested) come back to bite us at some point. As it turns out, >>PQsetvalue's operation on results that weren't cr

Re: [HACKERS] fixing PQsetvalue()

2011-06-23 Thread Dmitriy Igrishin
2011/6/23 Merlin Moncure > On Jun 6 ( > http://archives.postgresql.org/pgsql-hackers/2011-06/msg00272.php), > Pavel discovered an issue with PQsetvalue that could cause libpq to > wander off into unallocated memory that was present in 9.0.x. A > fairly uninteresting fix was quickly produced, but

Re: [HACKERS] Libpq enhancement

2011-06-19 Thread Dmitriy Igrishin
Hey Jeff, 2011/6/19 Jeff Shanab > I am wondering If I am missing something obvious. If not, I have a > suggestion for plpgsql. > > ** ** > > Stored procedures can accept rows. > > Libpq can receive rows (PQResult). > > ** ** > > Wouldn’t it be a great interface if PQResult was “bi-di

[HACKERS] Fwd: Multi-language glossary of PostgreSQL terms.

2011-03-15 Thread Dmitriy Igrishin
Hey all, Oleg Bartunov and I intend to begin the project of translation of PostgreSQL documentation on Russian. First of all, we want to create glossary to be used by translators. However we consider that it would be nice to generalize this idea and create a multi-language glossary of PostgreSQL t

Re: [HACKERS] libpq documentation cleanups (repost 3)

2011-01-12 Thread Dmitriy Igrishin
2011/1/12 Robert Haas > On Wed, Jan 12, 2011 at 11:53 AM, Bruce Momjian wrote: > > The attached patch is a collection of libpq documentation cleanups > > recommended in a list of changes emailed to me by Leslie S Satenstein. > > > > Leslie found a number of places our libpq documentation that we

Re: [HACKERS] proposal: FOREACH-IN-ARRAY (probably for 9.2?)

2010-12-17 Thread Dmitriy Igrishin
2010/12/17 Merlin Moncure > On Fri, Dec 17, 2010 at 11:38 AM, Tom Lane wrote: > > Pavel Stehule writes: > >> 2010/12/17 Tom Lane : > >>> Furthermore, it's underspecified: who's to say how many dimensions of > >>> the array are supposed to get sliced off? There's no reasonable place > >>> to ex

Re: [HACKERS] [GENERAL] queriing the version of libpq

2010-12-16 Thread Dmitriy Igrishin
Magnus, thats great ! And name PQlibVersion is correct ! Thanks. 2010/12/16 Magnus Hagander > On Tue, Dec 14, 2010 at 17:56, Massa, Harald Armin wrote: > >>> My question: Which way is available to query the linked libpq version? > > > >> But it does outline that fact that it wouldn't suck to ha

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/15 Robert Haas > On Wed, Dec 15, 2010 at 2:14 PM, Robert Haas > wrote: > > On Wed, Dec 15, 2010 at 1:22 PM, Dmitriy Igrishin > wrote: > >> Yes, but range of PostgreSQL's OIDs can be reserved. One or even ten > >> millions, e.g. can be enough.

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/16 Florian Pflug > On Dec15, 2010, at 21:28 , Dimitri Fontaine wrote: > > Florian Pflug writes: > >> Not if CREATE EXTENSION allows you install hstore into an arbitrary > schema. > > > > It also allows you to change it after the fact, and to easily track it > > down. Here's an updated ve

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/15 Dmitriy Igrishin > > > 2010/12/15 Pavel Stehule > > 2010/12/15 Dmitriy Igrishin : >> > >> > >> > 2010/12/15 Florian Pflug >> >> >> >> On Dec15, 2010, at 18:33 , Dmitriy Igrishin wrote: >> >> > 20

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/15 Dmitriy Igrishin > > > 2010/12/15 Robert Haas > > On Wed, Dec 15, 2010 at 2:14 PM, Robert Haas >> wrote: >> > On Wed, Dec 15, 2010 at 1:22 PM, Dmitriy Igrishin >> wrote: >> >> Yes, but range of PostgreSQL's OIDs can be reserve

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/15 Pavel Stehule > 2010/12/15 Dmitriy Igrishin : > > > > > > 2010/12/15 Florian Pflug > >> > >> On Dec15, 2010, at 18:33 , Dmitriy Igrishin wrote: > >> > 2010/12/15 Florian Pflug > >> > On Dec15, 2010, at 16:18 , Dmitriy I

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/15 Florian Pflug > On Dec15, 2010, at 18:33 , Dmitriy Igrishin wrote: > > 2010/12/15 Florian Pflug > > On Dec15, 2010, at 16:18 , Dmitriy Igrishin wrote: > > >> 2010/12/15 Florian Pflug > > >> On Dec15, 2010, at 02:14 , James William Pye wrote: &g

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/15 Florian Pflug > On Dec15, 2010, at 16:18 , Dmitriy Igrishin wrote: > >> 2010/12/15 Florian Pflug > >> On Dec15, 2010, at 02:14 , James William Pye wrote: > >> > On Dec 13, 2010, at 6:16 PM, Tom Lane wrote: > >> >> how do you identify wh

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/15 Jan Urbański > On 15/12/10 16:11, Tom Lane wrote: > > Robert Haas writes: > >> I was asking what would satisfy you as regards a reliable way to > >> identify a type, not what you think we should do about this particular > >> proposal. > > > > Okay: a preassigned OID is safe. I haven'

Re: [HACKERS] hstores in pl/python

2010-12-15 Thread Dmitriy Igrishin
2010/12/15 Florian Pflug > On Dec15, 2010, at 02:14 , James William Pye wrote: > > On Dec 13, 2010, at 6:16 PM, Tom Lane wrote: > >> how do you identify which type OID is really hstore? > > > > How about an identification field on pg_type? > > > > CREATE TYPE hstore ..., IDENTIFIER 'org.postgresq

Re: [HACKERS] hstores in pl/python

2010-12-14 Thread Dmitriy Igrishin
2010/12/14 Pavel Stehule > 2010/12/13 Dmitriy Igrishin : > > > > > > 2010/12/14 Pavel Stehule > >> > >> 2010/12/13 Dmitriy Igrishin : > >> > > >> > > >> > 2010/12/13 Pavel Stehule > >> >> &g

Re: [HACKERS] hstores in pl/python

2010-12-13 Thread Dmitriy Igrishin
2010/12/14 Pavel Stehule > 2010/12/13 Dmitriy Igrishin : > > > > > > 2010/12/13 Pavel Stehule > >> > >> 2010/12/13 Dmitriy Igrishin : > >> > > >> > > >> > 2010/12/13 Pavel Stehule > >> >> > >>

Re: [HACKERS] hstores in pl/python

2010-12-13 Thread Dmitriy Igrishin
2010/12/13 Pavel Stehule > 2010/12/13 Dmitriy Igrishin : > > > > > > 2010/12/13 Pavel Stehule > >> > >> 2010/12/13 Dmitriy Igrishin : > >> > There are a lot of operators and functions to work with hstore. > >> > Does it worth it to

Re: [HACKERS] hstores in pl/python

2010-12-13 Thread Dmitriy Igrishin
2010/12/13 Pavel Stehule > 2010/12/13 Dmitriy Igrishin : > > There are a lot of operators and functions to work with hstore. > > Does it worth it to implement similar things only to make it > > possible using operator [] ? > > yes > > > > > 2010/12/13 Pa

Re: [HACKERS] hstores in pl/python

2010-12-13 Thread Dmitriy Igrishin
There are a lot of operators and functions to work with hstore. Does it worth it to implement similar things only to make it possible using operator [] ? 2010/12/13 Pavel Stehule > >> > >> name and interface - hstore is designed as external module - a > >> internal class can be designed differen

Re: [HACKERS] hstores in pl/python

2010-12-13 Thread Dmitriy Igrishin
/13 Pavel Stehule > 2010/12/13 Dmitriy Igrishin : > > Hey Pavel, > > > > 2010/12/13 Pavel Stehule > >> > >> Hello > >> > >> this is little bit offtopic, sorry. > >> > >> I am thinking, so we need a standard associative arra

Re: [HACKERS] hstores in pl/python

2010-12-13 Thread Dmitriy Igrishin
Hey Pavel, 2010/12/13 Pavel Stehule > Hello > > this is little bit offtopic, sorry. > > I am thinking, so we need a standard associative array support in core > - like Perl, Python or Javascript. So, I don't think, so migration of > hstore to core is good idea. > Could you tell why in-core assoc

Re: [HACKERS] proposal: auxiliary functions for record type

2010-12-11 Thread Dmitriy Igrishin
Hey Pavel, Everything looks fine, but I propose you to add record_set_field just for convenience and as opposite of record_get_field. 2010/12/11 Pavel Stehule > Hello > > I wrote a few functions for record type - record_expand, > record_get_fields, record_get_field, record_set_fields. > > A usa

Re: [HACKERS] Fwd: Extended query protocol and exact types matches.

2010-12-10 Thread Dmitriy Igrishin
2010/12/10 Robert Haas > On Fri, Dec 10, 2010 at 11:46 AM, Dmitriy Igrishin > wrote: > > It would be quicker to answer my question and help than to teach me > > the alphabet of communication. Although, thank you, and for that :-) > > It would be quicker still to igno

Re: [HACKERS] Fwd: Extended query protocol and exact types matches.

2010-12-10 Thread Dmitriy Igrishin
Hey Kevin, Oh, I am sorry! Thanks! 2010/12/10 Kevin Grittner > Dmitriy Igrishin wrote: > > > Where is it written ? > > > http://wiki.postgresql.org/wiki/Guide_to_reporting_problems#Things_Not_To_Do > > -Kevin > > -- // Dmitriy.

Re: [HACKERS] Fwd: Extended query protocol and exact types matches.

2010-12-10 Thread Dmitriy Igrishin
Hey Robert, 2010/12/10 Robert Haas > On Fri, Dec 10, 2010 at 2:53 AM, Dmitriy Igrishin > wrote: > > [ message that was forwarded to three mailing lists in an 12 hour period > ] > > Come on, give me a break! Please sorry ! But I don't mail to you personally. &g

[HACKERS] Fwd: Extended query protocol and exact types matches.

2010-12-09 Thread Dmitriy Igrishin
-- Forwarded message -- From: Dmitriy Igrishin Date: 2010/12/10 Subject: Fwd: Extended query protocol and exact types matches. To: postgres list Hey sql@, -- Forwarded message -- From: Dmitriy Igrishin Date: 2010/12/9 Subject: Extended query protocol and

Re: [HACKERS] pg_type.typname of array types.

2010-12-08 Thread Dmitriy Igrishin
ithout pointing me to the sources. Respect! :-) 2010/12/8 Robert Haas > On Wed, Dec 8, 2010 at 11:09 AM, Tom Lane wrote: > > Dmitriy Igrishin writes: > >> I always read the documentation, but don't want (yes, don't want) > >> to read a lot of code to get the answ

Re: [HACKERS] pg_type.typname of array types.

2010-12-08 Thread Dmitriy Igrishin
Hey Tom, Thanks you too. I always read the documentation, but don't want (yes, don't want) to read a lot of code to get the answer on simple question because life is too short for it. I think that people should helps each other :-) 2010/12/8 Tom Lane > Dmitriy Igrishin writ

Re: [HACKERS] pg_type.typname of array types.

2010-12-08 Thread Dmitriy Igrishin
Hey Andrew, Finally convinced. Thanks! 2010/12/8 Andrew Dunstan > > > On 12/08/2010 05:35 AM, Dmitriy Igrishin wrote: > >> Hey hackers@, >> >> Is it guaranteed that name of array types in pg_type system >> catalog will always be prefixed by underscore or

Re: [HACKERS] pg_type.typname of array types.

2010-12-08 Thread Dmitriy Igrishin
Hey Florian, Thank you very much! 2010/12/8 Florian Pflug > On Dec8, 2010, at 11:35 , Dmitriy Igrishin wrote: > > Is it guaranteed that name of array types in pg_type system > > catalog will always be prefixed by underscore or this convention > > can be changed in fu

[HACKERS] pg_type.typname of array types.

2010-12-08 Thread Dmitriy Igrishin
Hey hackers@, Is it guaranteed that name of array types in pg_type system catalog will always be prefixed by underscore or this convention can be changed in future ? Thanks. -- // Dmitriy.

Re: [HACKERS] Feature request - CREATE TYPE ... WITH OID = oid_number.

2010-12-08 Thread Dmitriy Igrishin
2 AM, Merlin Moncure wrote: > >> On Tue, Dec 7, 2010 at 9:10 AM, Dmitriy Igrishin > >> wrote: > >>> > >>> Hey hackers@, > >>> > >>> libpq execution function works with OIDs. In some cases it is > >>> highly recommended s

Re: [HACKERS] Feature request - CREATE TYPE ... WITH OID = oid_number.

2010-12-07 Thread Dmitriy Igrishin
The reasons are simple, particularly, I don't want to bloat SQL with CAST or ::. Its not elegant and looks ugly. If I need to bind e.g. int or short I don't want write ::integer or ::smallint in SQL, because I can easily map int to integer via OID... I don't clearly understand how set_next_pg_type_

[HACKERS] Feature request - CREATE TYPE ... WITH OID = oid_number.

2010-12-07 Thread Dmitriy Igrishin
Hey hackers@, libpq execution function works with OIDs. In some cases it is highly recommended specify OIDs of parameters according to libpq documentation. While developing a database application with libpq and if application works with custom data types IMO reasonable to provide developer extende

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Dmitriy Igrishin
2010/12/6 Andrew Chernow > On 12/6/2010 11:40 AM, Dmitriy Igrishin wrote: > >> IMO, it would be better to implement some utility functions to >> make it easy to construct arrays dynamically for PQexecParams >> and PQexecPrepared. This seems to me more universal solution

Re: [HACKERS] Suggesting a libpq addition

2010-12-06 Thread Dmitriy Igrishin
IMO, it would be better to implement some utility functions to make it easy to construct arrays dynamically for PQexecParams and PQexecPrepared. This seems to me more universal solution and it is useful for both -- high level libpq-libraries authors and for those who like to use libpq directly. 20

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Dmitriy Igrishin
Hey Andrew, No, thanks. :-) And I don't think that libpq should follows it (libpqtypes). 2010/12/6 Andrew Chernow > > A varargs version of PQexecParams() would be handy, though. Imagine being >> able >> to do: >> >> PQexecVParams("SELECT * FROM mytable WHERE foo = $1 AND bar = $2", foovar, >>

Re: [HACKERS] Suggesting a libpq addition

2010-12-05 Thread Dmitriy Igrishin
Hey hackers, Varargs-exec is useful only when programmer calls it directly. It is useless when libpq is used to create a more flexible high-level library (e.g., for C++). PQexecParams (PQexecPrepared) are good for it. What about auto reconnect. There are PQreset already and PG_CONNECTION_OK (_BAD

Re: [HACKERS] DELETE with LIMIT (or my first hack)

2010-12-01 Thread Dmitriy Igrishin
Hey, I don't clearly understand why anybody should perform DELETE directly from a psql terminal on a production system. WHY ? I can't understand what problem with DELETE without WHERE clause for application developers and why DBMS should "protect" them from DELETE FROM table. PS. Anybody can perf

Re: [HACKERS] Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running

2010-11-26 Thread Dmitriy Igrishin
Hey hackers, I am sorry, but is it possible to implement BTW ability to check exactly status of authentication from libpq ? As for now, the only way to check failed authentication is parsing the error message, that is sadly. 2010/11/26 Bruce Momjian > Fujii Masao wrote: > > On Fri, Nov 26, 2010

Re: [HACKERS] Suggested "easy" TODO: pg_dump --from-list

2010-11-26 Thread Dmitriy Igrishin
Hey Dimitri, hackers, Okay, there is a some getddl utility. But as for me, it does not simplify the development. It is "file-based pgAdmin" with the exception that I can use, e.g. Emacs for editing rather than build-in editor of pgAdmin. But I can use Emacs from psql(1)... Without some "restoredd

Re: [HACKERS] Suggested "easy" TODO: pg_dump --from-list

2010-11-24 Thread Dmitriy Igrishin
Hey hackers, Completely agree with Robert ! It would be nice to dump functions definitions, e.g. to make it possible keep them in git separately. I also want to propose to make it possible dump function definitions as CREATE OR REPLACE FUNCTION rather than just CREATE FUNCTION (as pg_dump dumps th

Re: [HACKERS] proposal: plpgsql - iteration over fields of rec or row variable

2010-11-09 Thread Dmitriy Igrishin
Hey David, 2010/11/9 David E. Wheeler > On Nov 9, 2010, at 1:38 AM, Dmitriy Igrishin wrote: > > > * text[] = record_to_array(record) > > * table(id, key, datatype, value) = record_to_table(record) > > * text = record_get_field(record, text) > > * record =

Re: [HACKERS] proposal: plpgsql - iteration over fields of rec or row variable

2010-11-09 Thread Dmitriy Igrishin
Hey Pavel, 2010/11/9 Pavel Stehule > > a) transformation to common type > > > > + simple - it is one day job - function record_to_array, > > array_to_record, and fieldnames_to_array > > - lost of type info, hidden problems with IO cast - int a := 10.0/2.0 > > is a problem > > > > using a plperl

Re: [HACKERS] proposal: plpgsql - iteration over fields of rec or row variable

2010-11-08 Thread Dmitriy Igrishin
10 at 3:02 PM, Dmitriy Igrishin > wrote: > > Hey Pavel, Tom, Merlin, > > > > As a user, I would like to work with records by using simple API: > > > > -- Returns a number of key/values pairs of record. > > nKeys_ integer := nRecordKeys(NEW); > > >

Re: [HACKERS] proposal: plpgsql - iteration over fields of rec or row variable

2010-11-08 Thread Dmitriy Igrishin
Hey Pavel, Tom, Merlin, As a user, I would like to work with records by using simple API: -- Returns a number of key/values pairs of record. nKeys_ integer := nRecordKeys(NEW); -- Returns an i-th key. key_i text := recordKey(NEW, i); -- Returns an i-th value. value1_ text := recordV

Re: [HACKERS] How to determine failed connection attempt due to invalid authorization (libpq)?

2010-10-16 Thread Dmitriy Igrishin
Hey Robert, I've asked pgsql-general. Unfortunately it seems that there is no better way to do it except parsing PQerrorMessage(). Sadly. 2010/10/17 Robert Haas > On Thu, Oct 14, 2010 at 2:59 PM, Dmitriy Igrishin > wrote: > > Is there way to determine failed connection attem

[HACKERS] How to determine failed connection attempt due to invalid authorization (libpq)?

2010-10-14 Thread Dmitriy Igrishin
Hey all, Is there way to determine failed connection attempt due to invalid authorization (libpq)? -- // Dmitriy.

Re: [HACKERS] Large objects.

2010-09-27 Thread Dmitriy Igrishin
Hey Robert, Tom Tom, thank you for explanation! Ouch. Letting people write data to where they can't get it back from > seems double-plus ungood. > > Robert, yes, I agree with you. This is exactly what I wanted to say. I've implemented a stream class in C++ and this circumstance makes the code no

Re: [HACKERS] Large objects.

2010-09-26 Thread Dmitriy Igrishin
Hey Robert, Yes, I am sure. I've tested it by test case in my original post. Do you can compile and reproduce it please? -- // Dmitriy.

[HACKERS] Large objects.

2010-09-24 Thread Dmitriy Igrishin
Hey all, Here is simple test case of LOB usage, please, note the comments: #include #include int main(int argc, char* argv[]) { PGconn* c = PQconnectdb("password=test"); PGresult* r = PQexec(c, "BEGIN"); PQclear(r); const unsigned int id = lo_create(c, 0); int fd1 = lo_open(c, id,

Re: [HACKERS] SQLSTATE of notice PGresult

2010-09-22 Thread Dmitriy Igrishin
Hey all, Okay, as Robert points, "0" code in successful messages seems as waste of bytes. But according to the documentation, "All messages emitted by the PostgreSQL server are assigned five-character error codes that follow the SQL standard's conventions for "SQLSTATE" codes." - the first sen

[HACKERS] SQLSTATE of notice PGresult

2010-08-20 Thread Dmitriy Igrishin
Hey all, Accordingly to the documentation of libpq, SQLSTATE code field "is not localizable, and is always present.". But it seems, in some cases it isn't. E.g. /* the main code */ PGresult* res = Pg::PQexec(conn, "select 1"); Oid id = PQparamtype(res, 1); /* the notice receiver */ voi

Re: [HACKERS] Conflicted names of error conditions.

2010-08-16 Thread Dmitriy Igrishin
Thanks for you answer, Tom! I've implemented mapping between SQLSTATE codes and C++ exception classes of my library. And of course, I've resolved the conflict of names by giving a proper name to my classes. Regards, Dmitriy 2010/8/16 Tom Lane > Dmitriy Igrishin writes: >

[HACKERS] Conflicted names of error conditions.

2010-08-16 Thread Dmitriy Igrishin
Hey all, According to http://www.postgresql.org/docs/9.0/static/errcodes-appendix.html some error conditions has non-unique *names*. There are: modifying_sql_data_not_permitted, prohibited_sql_statement_attempted, reading_sql_data_not_permitted from SQL Routine Exception and External Routine Excep

[HACKERS] libpq and TOO MANY CONNECTIONS

2010-08-12 Thread Dmitriy Igrishin
Hey all, It seams, that all of the error codes should be obtained by calling PQresultErrorField(). But this function works only with results. So in what situations TOO MANY CONNECTIONS error may be thrown after successfully connection ? :) In case of dblink? Regards, Dmitriy

[HACKERS] libpq

2010-08-12 Thread Dmitriy Igrishin
Hey all, Is it guaranteed that functions, which accept PGconn* (PGresult*) properly works if PGconn* (PGresult*) is NULL or is it better to check on NULL the value of the pointer before calling those functions? Regards, Dmitriy