Re: [HACKERS] Linking libpq statically to libssl

2017-10-27 Thread Daniele Varrazzo
On Fri, Oct 27, 2017 at 2:37 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Daniele Varrazzo <daniele.varra...@gmail.com> writes: >> I have a problem building binary packages for psycopg2. Binary >> packages ship with their own copies of libpq and libssl; however if >

[HACKERS] Linking libpq statically to libssl

2017-10-27 Thread Daniele Varrazzo
Hello, I have a problem building binary packages for psycopg2. Binary packages ship with their own copies of libpq and libssl; however if another python package links to libssl the library will be imported twice with conflicting symbols, likely resulting in a segfault (see

[HACKERS] Help required to debug pg_repack breaking logical replication

2017-10-07 Thread Daniele Varrazzo
Hello, we have been reported, and I have experienced a couple of times, pg_repack breaking logical replication. - https://github.com/reorg/pg_repack/issues/135 - https://github.com/2ndQuadrant/pglogical/issues/113 In my experience, after the botched run, the replication slot was "stuck", and

Re: [pgsql-translators] [HACKERS] translatable string fixes

2017-05-24 Thread Daniele Varrazzo
On Tue, May 23, 2017 at 1:15 AM, Alvaro Herrera wrote: > It took me a very long time to figure out how to translate these 9.6-new > strings in the AM validate routines: > > msgid "gin operator family \"%s\" contains support procedure %s with > cross-type registration" >

Re: [HACKERS] Detecting schema changes during logical replication

2017-05-08 Thread Daniele Varrazzo
On Mon, May 8, 2017 at 3:48 AM, Craig Ringer wrote: > Sounds like you're reimplementing pglogical > (http://2ndquadrant.com/pglogical) on top of a json protocol. The fact the protocol is JSON is more a detail, but it's a good start as it's human-readable. > [...]

Re: [HACKERS] Detecting schema changes during logical replication

2017-05-07 Thread Daniele Varrazzo
On Sun, May 7, 2017 at 8:04 PM, Andres Freund <and...@anarazel.de> wrote: > Hi, > > On 2017-05-07 19:27:08 +0100, Daniele Varrazzo wrote: >> I'm putting together a replication system based on logical >> replication. > > Interesting. If you very briefly could re

[HACKERS] Detecting schema changes during logical replication

2017-05-07 Thread Daniele Varrazzo
Hello, I'm putting together a replication system based on logical replication. I would like to send table information only the first time a table is seen by the 'change_cb' callback, but of course there could be some schema change after replication started. So I wonder: is there any information I

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-13 Thread Daniele Varrazzo
On Mon, Feb 13, 2017 at 3:09 AM, Jim Nasby <jim.na...@bluetreble.com> wrote: > On 2/7/17 9:16 AM, Daniele Varrazzo wrote: >> >> Thank you for the clarification: I will assume the behaviour cannot be >> maintained on PG 10 and think whether the treatment of '{}'

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Daniele Varrazzo
On Tue, Feb 7, 2017 at 2:59 PM, Andreas Karlsson <andr...@proxel.se> wrote: > On 02/07/2017 03:14 PM, Daniele Varrazzo wrote: >> >> In psycopg '{}'::unknown is treated specially as an empty array and >> converted into an empty list, which allows empty lists to be passed

Re: [HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Daniele Varrazzo
On Tue, Feb 7, 2017 at 2:42 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Daniele Varrazzo <daniele.varra...@gmail.com> writes: >> testing with psycopg2 against Postgres 10 I've found a difference in >> behaviour regarding literals, which are returned as

[HACKERS] 'text' instead of 'unknown' in Postgres 10

2017-02-07 Thread Daniele Varrazzo
Hello, testing with psycopg2 against Postgres 10 I've found a difference in behaviour regarding literals, which are returned as text instead of unknown. In previous versions: In [2]: cnn = psycopg2.connect('') In [3]: cur = cnn.cursor() In [7]: cur.execute("select 'x'") In [9]:

[HACKERS] Redundant error messages in policy.c

2015-07-06 Thread Daniele Varrazzo
There are 5 different strings (one has a whitespace error), they could be 2. Patch attached. postgresql/src/backend$ grep errmsg commands/policy.c | grep policy | sed 's/^ *//' errmsg(policy \%s\ for relation \%s\ already exists, errmsg(policy \%s\ on table \%s\ does not exist, errmsg(policy

[HACKERS] Spurious full-stop in message

2015-07-06 Thread Daniele Varrazzo
postgresql/src/backend$ grep must be superuser to change bypassrls attribute commands/user.c | sed 's/ \+//' errmsg(must be superuser to change bypassrls attribute.))); errmsg(must be superuser to change bypassrls attribute))); Patch to fix attached. diff --git

[HACKERS] libpq connection status and closed fd

2014-09-22 Thread 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 conditions result in the same effect, but I'll stick to

Re: [HACKERS] libpq connection status and closed fd

2014-09-22 Thread Daniele Varrazzo
On Mon, Sep 22, 2014 at 8:17 AM, Dmitriy Igrishin dmit...@gmail.com wrote: 2014-09-22 10:42 GMT+04:00 Daniele Varrazzo daniele.varra...@gmail.com: [2] https://gist.github.com/dvarrazzo/065f343c95f8ea67cf8f Why are you using close() instead of PQfinish()? Because I'm testing for an error

Re: [HACKERS] Fixed redundant i18n strings in json

2014-08-02 Thread Daniele Varrazzo
PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Jul 30, 2014 at 2:59 PM, Daniele Varrazzo daniele.varra...@gmail.com wrote: Please find attached a small tweak to a couple of strings found while updating translations. The %d version is already used elsewhere in the same file. Probably

[HACKERS] Fixed redundant i18n strings in json

2014-07-30 Thread Daniele Varrazzo
Please find attached a small tweak to a couple of strings found while updating translations. The %d version is already used elsewhere in the same file. -- Daniele diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index 2f99908..2aa27cc 100644 ---

Re: [HACKERS] jsonb and nested hstore

2014-03-06 Thread Daniele Varrazzo
On Thu, Mar 6, 2014 at 6:54 PM, Josh Berkus j...@agliodbs.com wrote: The actual storage upgrade of hstore--hstore2 is fairly painless from the user perspective; they don't have to do anything. The problem is that the input/output strings are different, something which I didn't think to check

Re: [HACKERS] jsonb and nested hstore

2014-03-06 Thread Daniele Varrazzo
On Thu, Mar 6, 2014 at 9:10 PM, Peter Geoghegan p...@heroku.com wrote: On Thu, Mar 6, 2014 at 12:58 PM, Daniele Varrazzo daniele.varra...@gmail.com wrote: Hello, psycopg developer here. Not following the entire thread as it's quite articulated and not of my direct interest (nor comprehension

[HACKERS] Changing schema on the fly

2013-04-17 Thread Daniele Varrazzo
Hello dear -hackers, I'm maintaining pg_reorg/pg_repack, which you may know effectively allow online VACUUM FULL or CLUSTER. It works by installing logging triggers to keep data up-to-date during the migration, creating a copy of the table, and eventually swapping the tables relfilenodes. The

[HACKERS] A few string fixed

2013-03-20 Thread Daniele Varrazzo
Hello, while translating the new PostgreSQL 9.3 strings I've found a couple questionable. Patches attached. Cheers, -- Daniele 0001-Fixed-MultiXactIds-string-warning.patch Description: Binary data 0002-Fixed-pasto-in-hint-string-about-making-views-deleta.patch Description: Binary data --

Re: [HACKERS] A few string fixed

2013-03-20 Thread Daniele Varrazzo
On Wed, Mar 20, 2013 at 2:01 PM, Tom Lane t...@sss.pgh.pa.us wrote: Daniele Varrazzo daniele.varra...@gmail.com writes: while translating the new PostgreSQL 9.3 strings I've found a couple questionable. Patches attached. Hmm ... I agree with the MultiXactId-MultiXactIds changes

Re: [RFC] ideas for a new Python DBAPI driver (was Re: [HACKERS] libpq test suite)

2013-02-15 Thread Daniele Varrazzo
On Fri, Feb 15, 2013 at 9:28 PM, Peter Eisentraut pete...@gmx.net wrote: On 2/14/13 2:42 PM, Marko Tiikkaja wrote: I think the reason this doesn't work is that in order to prepare a query you need to know the parameter types, but you don't know that in Python, or at least with the way the

Re: [HACKERS] PL/Python result object str handler

2013-01-08 Thread Daniele Varrazzo
On Tue, Jan 8, 2013 at 9:32 AM, Magnus Hagander mag...@hagander.net wrote: On Tue, Jan 8, 2013 at 3:58 AM, Peter Eisentraut pete...@gmx.net wrote: For debugging PL/Python functions, I'm often tempted to write something like rv = plpy.execute(...) plpy.info(rv) which prints something

Re: [HACKERS] allowing multiple PQclear() calls

2012-12-11 Thread Daniele Varrazzo
On Tue, Dec 11, 2012 at 12:43 PM, Josh Kupershmidt schmi...@gmail.com wrote: Ah, well. I guess using a macro like: #define SafeClear(res) do {PQclear(res); res = NULL;} while (0); will suffice for me. Psycopg uses: #define IFCLEARPGRES(pgres) if (pgres) {PQclear(pgres); pgres = NULL;} --

Re: [HACKERS] Resetting libpq connections after an app error

2012-10-06 Thread Daniele Varrazzo
On Sat, Jul 21, 2012 at 5:36 PM, Tom Lane t...@sss.pgh.pa.us wrote: Martijn van Oosterhout klep...@svana.org writes: On Sat, Jul 21, 2012 at 01:08:58AM +0100, Daniele Varrazzo wrote: In a libpq application, if there is an application error between PQsendQuery and PQgetResult, is there a way

Re: [HACKERS] pg_reorg in core?

2012-09-22 Thread Daniele Varrazzo
On Fri, Sep 21, 2012 at 9:45 AM, M.Sakamoto sakamoto_masahiko...@lab.ntt.co.jp wrote: Hi, I'm sakamoto, maintainer of reorg. What could be also great is to move the project directly into github to facilitate its maintenance and development. No argument from me there, especially as I have my

Re: [HACKERS] pg_reorg in core?

2012-09-21 Thread Daniele Varrazzo
On Fri, Sep 21, 2012 at 5:17 AM, Josh Kupershmidt schmi...@gmail.com wrote: If the argument for moving pg_reorg into core is faster and easier development, well I don't really buy that. I don't see any problem in having pg_reorg in PGXN instead. I've tried adding a META.json to the project

[HACKERS] Resetting libpq connections after an app error

2012-07-20 Thread Daniele Varrazzo
Hello, apologize for bumping the question to -hackers but I got no answer from -general. If there is a better ML to post it let me know. In a libpq application, if there is an application error between PQsendQuery and PQgetResult, is there a way to revert a connection back to an usable state

Re: [HACKERS] Potential reference miscounts and segfaults in plpython.c

2012-03-29 Thread Daniele Varrazzo
On Thu, Feb 23, 2012 at 8:35 PM, Daniele Varrazzo daniele.varra...@gmail.com wrote: On Mon, Feb 20, 2012 at 12:09 AM, Jan Urbański wulc...@wulczer.org wrote: BTW, that tool is quite handy, I'll have to try running it over psycopg2. Indeed. I'm having a play with it. It is reporting several

Re: [HACKERS] Patch: improve selectivity estimation for IN/NOT IN

2012-03-04 Thread Daniele Varrazzo
On Sun, Mar 4, 2012 at 1:44 PM, Euler Taveira de Oliveira eu...@timbira.com wrote: On 04-03-2012 00:20, Daniele Varrazzo wrote: It looks like you have grand plans for array estimation. My patch has a much more modest scope, and I'm hoping it could be applied to currently maintained PG versions

[HACKERS] Patch: improve selectivity estimation for IN/NOT IN

2012-03-03 Thread Daniele Varrazzo
d10e60dd3dec340b96b372792e4a0650ec10da92 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo daniele.varra...@gmail.com Date: Sat, 3 Mar 2012 19:27:16 + Subject: [PATCH] Improve array selectivity estimation for = ANY and ALL Assume distinct array elements, hence disjoint probabilities instead of independent. Using the wrong probability

Re: [HACKERS] Patch: improve selectivity estimation for IN/NOT IN

2012-03-03 Thread Daniele Varrazzo
On Sun, Mar 4, 2012 at 2:38 AM, Tom Lane t...@sss.pgh.pa.us wrote: Daniele Varrazzo daniele.varra...@gmail.com writes: the attached patch improves the array selectivity estimation for = ANY and ALL, hence for the IN/NOT IN operators, to avoid the shortcoming described in http

Re: [HACKERS] Potential reference miscounts and segfaults in plpython.c

2012-02-23 Thread Daniele Varrazzo
On Mon, Feb 20, 2012 at 12:09 AM, Jan Urbański wulc...@wulczer.org wrote: BTW, that tool is quite handy, I'll have to try running it over psycopg2. Indeed. I'm having a play with it. It is reporting several issues to clean up (mostly on failure at module import). It's also tracebacking here and

Re: [HACKERS] Extension Packaging

2011-04-28 Thread Daniele Varrazzo
, such as foo_revision(), so that pre-9.1 code can work with it as well. -- Daniele From 03fa593a46f1dae0a8e83b4bccd6dea51e2c102c Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo daniele.varra...@gmail.com Date: Thu, 28 Apr 2011 14:02:08 +0100 Subject: [PATCH] Added paragraph about the distinction between

Re: [HACKERS] Extension Packaging

2011-04-28 Thread Daniele Varrazzo
On Thu, Apr 28, 2011 at 2:21 PM, Marko Kreen mark...@gmail.com wrote: On Thu, Apr 28, 2011 at 4:07 PM, Daniele Varrazzo daniele.varra...@gmail.com wrote: On Wed, Apr 27, 2011 at 1:48 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Tom Lane t...@sss.pgh.pa.us writes: If you didn't change

Re: [HACKERS] Extension Packaging

2011-04-28 Thread Daniele Varrazzo
On Thu, Apr 28, 2011 at 3:04 PM, Tom Lane t...@sss.pgh.pa.us wrote: Daniele Varrazzo daniele.varra...@gmail.com writes: On Thu, Apr 28, 2011 at 2:21 PM, Marko Kreen mark...@gmail.com wrote: How about each .so containing a version callback? Thus you can show what is the version of underlying

Re: [HACKERS] maximum digits for NUMERIC

2011-04-27 Thread Daniele Varrazzo
On Wed, Apr 27, 2011 at 4:47 AM, Bruce Momjian br...@momjian.us wrote: Alvaro Herrera wrote: Excerpts from Bruce Momjian's message of mar abr 26 12:58:19 -0300 2011: Wow, I am so glad someone documented this.  I often do factorial(4000) which generates 12673 digits when teaching classes,

Re: [HACKERS] Extension Packaging

2011-04-24 Thread Daniele Varrazzo
On Sun, Apr 24, 2011 at 10:46 PM, Tom Lane t...@sss.pgh.pa.us wrote: Daniele Varrazzo daniele.varra...@gmail.com writes: On Thu, Apr 21, 2011 at 4:16 AM, Tom Lane t...@sss.pgh.pa.us wrote: If you did not actually change the contents of the install script, you should not change its version

Re: [HACKERS] Extension Packaging

2011-04-23 Thread Daniele Varrazzo
On Thu, Apr 21, 2011 at 4:16 AM, Tom Lane t...@sss.pgh.pa.us wrote: David E. Wheeler da...@kineticode.com writes: * Another, minor point: If I release a new version with no changes to the code (as I've done today, just changing the make stuff and documentation), it's kind of annoying that

Re: [HACKERS] Extension Packaging

2011-04-20 Thread Daniele Varrazzo
On Thu, Apr 21, 2011 at 1:14 AM, David E. Wheeler da...@kineticode.com wrote: I finally got round to updating a couple of my extensions to support 9.1 extensions. Unlike the contrib extensions, these needed to target older versions of PostgreSQL, as well. Case in point, the semver data type;

[HACKERS] getting composite types info from libpq

2010-12-15 Thread Daniele Varrazzo
Hello, when a query returns a composite type, the libpq PQftype() function reports the oid of the record type. In psycopg: cur.execute(select (1,2)) cur.description (('row', 2249, None, -1, None, None, None),) test=# select typname from pg_type where oid = 2249; typname

Re: [HACKERS] getting composite types info from libpq

2010-12-15 Thread Daniele Varrazzo
On Wed, Dec 15, 2010 at 6:56 PM, Merlin Moncure mmonc...@gmail.com wrote: On Wed, Dec 15, 2010 at 1:25 PM, Daniele Varrazzo daniele.varra...@gmail.com wrote: Hello, when a query returns a composite type, the libpq PQftype() function reports the oid of the record type. In psycopg

Re: [HACKERS] psycopg and two phase commit

2010-11-06 Thread Daniele Varrazzo
On Fri, Nov 5, 2010 at 5:16 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2010/11/4 Daniele Varrazzo daniele.varra...@gmail.com: Just wanted to warn you that I have implemented the 2pc protocol in psycopg. I read a notice, but I didn't find a link for download, where is it, please? We

Re: [HACKERS] psycopg and two phase commit

2010-11-04 Thread Daniele Varrazzo
On Sat, Sep 18, 2010 at 5:01 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello who is psycopg maintainer, please? Can somebody explains to me, why psycopg doesn't support twophase commit still, although some implementation was done in summer 2008? Hello Pavel, Just wanted to warn you

Re: [HACKERS] psycopg and two phase commit

2010-09-19 Thread Daniele Varrazzo
On Sat, Sep 18, 2010 at 5:01 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello who is psycopg maintainer, please? Here is one. The others can be usually mailed on the psycopg mailing list, which is currently down and being recovered. Can somebody explains to me, why psycopg doesn't

Re: [HACKERS] psycopg and two phase commit

2010-09-19 Thread Daniele Varrazzo
On Sun, Sep 19, 2010 at 6:38 PM, Daniele Varrazzo daniele.varra...@gmail.com wrote: On Sat, Sep 18, 2010 at 5:01 PM, Pavel Stehule pavel.steh...@gmail.com wrote: There are some bariers? I see none at a first glance. I just don't get the intricacies of the .xid() method suggested

[HACKERS] Adding regexp_match() function

2010-05-30 Thread Daniele Varrazzo
Hello, I'd like to contribute a regexp_match() function as discussed in bug #5469 [1] The aim is to overcome the limitation outlined in the thread above http://archives.postgresql.org/pgsql-bugs/2010-05/msg00227.php. PostgreSQL currently offers the function regexp_matches(), a SRF (which, unless