Skip Menu |
 

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 109244
Status: rejected
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: skaurus [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
X-Spam-Status: No, score=-1.192 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SUBJ_ALL_CAPS=1.506] autolearn=no
X-Spam-Flag: NO
Content-Type: multipart/alternative; boundary="047d7b343d0e61cc090524fd391e"
Message-ID: <CAKPeCUHePqG7S4zGF0WwfrXNpo5=GLmwC=PB_4reEqqGJFFxEQ [...] mail.gmail.com>
X-Received: by 10.194.2.5 with SMTP id 5mr16228560wjq.153.1448044891580; Fri, 20 Nov 2015 10:41:31 -0800 (PST)
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -1.192
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 7DB782402CA for <cpan-bug+DBD-Pg [...] hipster.bestpractical.com>; Fri, 20 Nov 2015 13:41:49 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KYtGIHyNhr5g for <cpan-bug+DBD-Pg [...] hipster.bestpractical.com>; Fri, 20 Nov 2015 13:41:48 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C352C2400FD for <bug-DBD-Pg [...] rt.cpan.org>; Fri, 20 Nov 2015 13:41:47 -0500 (EST)
Received: (qmail 25164 invoked by alias); 20 Nov 2015 18:41:46 -0000
Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 20 Nov 2015 10:41:35 -0800
Received: by wmvv187 with SMTP id v187so84477332wmv.1 for <bug-DBD-Pg [...] rt.cpan.org>; Fri, 20 Nov 2015 10:41:31 -0800 (PST)
Received: by 10.27.220.20 with HTTP; Fri, 20 Nov 2015 10:41:12 -0800 (PST)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Delivered-To: cpan-bug+DBD-Pg [...] hipster.bestpractical.com
Subject: BEGIN READ ONLY
Return-Path: <skaurus [...] gmail.com>
X-RT-Mail-Extension: dbd-pg
X-Original-To: cpan-bug+DBD-Pg [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=3iD1feD6X1xhwTIXHJdO+Q7JAM+Z2/T1xsa+FEgOGNc=; b=Y7rW43v3OeXMahluJ7Kejlcd3UYEItAtr9Iy2c0xHNeOXMxcg6YUZJgt2STEgBCYeo pMbI0OcVIAu9WqbFuJvwo5+Fn6Ugezc7rPNA0FTaFxmgBEg9YBhX4OtL8eLWVW5CeK/3 NnoGiYUFtKUkLA69D8eJSJI1e84VJ/vaMefG/Ai986PdgLNcyV0iyPAViE7AtkE+MhIY YUaOYhT324MKUGJOYO+w+wVUbj1lndk0kBhQ+RT2bWOYJqP/ZyZ/KX7MmHND42nTaKkB PwhGzq6IDmAL9m5RS4a0Ay6fCPMrtAKxBYSFflji+ZBHJyoyQop7PSLuLE1p8sQV8oT9 F3rg==
Date: Fri, 20 Nov 2015 21:41:12 +0300
X-Spam-Level:
To: bug-DBD-Pg [...] rt.cpan.org
From: Дмитрий Шалашов <skaurus [...] gmail.com>
X-RT-Interface: Email
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 1035
Hi, could you expose BEGIN READ ONLY functionality? Why do we need this. We have following setup: * PostgreSQL 9.4 master + slave * pgpool-II 3.4.3 as connection pooler and load balancer * pgpool set up in a way that almost all read queries are balanced to slave. Problem lies within pgpool detection whether query writes or not (former ones can't be routed to slave). This query routes to slave: BEGIN; SELECT pg_sleep(15); -- pg_sleep used so it is easy to check where query is running COMMIT; But this query routes to master: BEGIN; SET TRANSACTION TO READ ONLY; -- we need this to don't grow XIDs on readonly queries SELECT pg_sleep(15); COMMIT; And this query routes correctly (to slave) again: BEGIN READ ONLY; SELECT pg_sleep(15); COMMIT; I hesitate calling DB directly like this: $dbh->do('BEGIN READ ONLY'); $dbh->do('SELECT pg_sleep(15)); $dbh->do('COMMIT'); because DBD::Pg have a lot going under its hood and I feel kinda insecure missing all this. Maybe I'm wrong here? Dmitry Shalashov, surfingbird.ru & relap.io
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 1708
MIME-Version: 1.0
In-Reply-To: <CAKPeCUHePqG7S4zGF0WwfrXNpo5=GLmwC=PB_4reEqqGJFFxEQ [...] mail.gmail.com>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <CAKPeCUHePqG7S4zGF0WwfrXNpo5=GLmwC=PB_4reEqqGJFFxEQ [...] mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-4761-1491185856-1602.109244-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 394
Download (untitled) / with headers
text/plain 394b
Show quoted text
> I hesitate calling DB directly like this: > $dbh->do('BEGIN READ ONLY'); > $dbh->do('SELECT pg_sleep(15)); > $dbh->do('COMMIT'); > because DBD::Pg have a lot going under its hood and I feel kinda insecure > missing all this. Maybe I'm wrong here?
I think you should be fine using do() like that. It is difficult to see how we would extend $dbh->begin_work() anyway, as it's a DBI method.
MIME-Version: 1.0
X-Spam-Status: No, score=-4.015 tagged_above=-99.9 required=10 tests=[AWL=1.318, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, FROM_OUR_RT=-4, HTML_MESSAGE=0.001, SPF_SOFTFAIL=0.665] autolearn=ham
In-Reply-To: <rt-4.0.18-4761-1491185857-1598.109244-6-0 [...] rt.cpan.org>
X-Cpan.org: This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings.
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-109244 [...] rt.cpan.org> <CAKPeCUHePqG7S4zGF0WwfrXNpo5=GLmwC=PB_4reEqqGJFFxEQ [...] mail.gmail.com> <rt-4.0.18-4761-1491185857-1598.109244-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.28.159.73 with SMTP id i70mr9147015wme.78.1491213788228; Mon, 03 Apr 2017 03:03:08 -0700 (PDT)
Message-ID: <CAKPeCUFuuL+m+rwKwR5p1K1V9z6N_1=NibuFxb9yRBtRTgdU2w [...] mail.gmail.com>
Content-Type: multipart/alternative; boundary="001a114530a421b2af054c404487"
X-Spam-Score: -4.015
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 0561024021E for <cpan-bug+DBD-Pg [...] hipster.bestpractical.com>; Mon, 3 Apr 2017 06:03:22 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AoIS36DLgbol for <cpan-bug+DBD-Pg [...] hipster.bestpractical.com>; Mon, 3 Apr 2017 06:03:20 -0400 (EDT)
Received: from xx1.develooper.com (xx1.develooper.com [207.171.7.115]) by hipster.bestpractical.com (Postfix) with ESMTPS id D527C2401A6 for <bug-DBD-Pg [...] rt.cpan.org>; Mon, 3 Apr 2017 06:03:19 -0400 (EDT)
Received: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id 82AB811D844 for <bug-DBD-Pg [...] rt.cpan.org>; Mon, 3 Apr 2017 03:03:18 -0700 (PDT)
Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id 8DA6111D3FC for <bug-DBD-Pg [...] rt.cpan.org>; Mon, 3 Apr 2017 03:03:13 -0700 (PDT)
Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id 7277111D3C0 for <bug-DBD-Pg [...] rt.cpan.org>; Mon, 3 Apr 2017 03:03:10 -0700 (PDT)
Received: by mail-lf0-f51.google.com with SMTP id j90so69708580lfk.2 for <bug-DBD-Pg [...] rt.cpan.org>; Mon, 03 Apr 2017 03:03:10 -0700 (PDT)
Received: by 10.28.57.130 with HTTP; Mon, 3 Apr 2017 03:02:47 -0700 (PDT)
Delivered-To: cpan-bug+DBD-Pg [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #109244] BEGIN READ ONLY
Return-Path: <skaurus [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=1VvA6F6R3jJNLf2HNkY4P3JR8bcr4DXzFx6uBF/0D0s=; b=GxcqB0a1e64AeQ/xvD/NhMB9gWwLZQOjOdgXEzZFktCOPeuzXQ6Z64eoAJey/ceeKQ JbvvLcLxAcpxa5Hq1jX2VTdp9slcdd8X2xNvhKoBDZ+T9uxcyweTruYmiSptiPCnFxy+ 239xHF8KIFI1raha68QrU1mgB/WIXbWEnC6JdgFxwMgCM+v0wvbU3TEVC09ZtH15Hh0R cBUx22SncU9xY6rpIa47dSL4kcbVe+Q+wCNY+41AYhyVHquKcfBx3Xy6MEgKzZ4GIFae FFUoxzSeWvg0u7y64KtcEjPtSgxvDwoI46vvF5U+w0Ewqu6QI5QcJIEY1xU3f4fT7x31 Qj4g==
X-Original-To: cpan-bug+DBD-Pg [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-pg
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=1VvA6F6R3jJNLf2HNkY4P3JR8bcr4DXzFx6uBF/0D0s=; b=WOyP6hR11RjI8Y4WmT57iFfV1i9EpEJ4cMSxho7X8Er1osYhr6LzKhDcesNOXzQ1Bg F3PSfuyQAw23yQkEbpJOlpcFG96qgYSgxSliDf+C75xRfxk7RMvS/RLPRkWm+9n4czjZ TuWeucAqXj+V4yw3xhXG/dSRCZZNMEzwvgFlnlA/lx71dH02pIhCfZ5DJIIShEC5uIFs 55siul/GLPguHefYvPhMLpGfGKf8iRbLJ3wfjiAzbmOn8FlFdAd2He8xA/wFx63FgRJh URnSvv6kSJiz1oAQO5vWkXiHpzYnWOVKGX0tJhMF5Mct3plDIaL+n8FDkuQJgNgMQhYl tu+Q==
Date: Mon, 3 Apr 2017 13:02:47 +0300
X-PMX-Spam: Gauge=XII, Probability=12%, Report=' RU_TLD 0.5, RU_TLD_HREF_URI 0.5, HTML_50_70 0.1, BODYTEXTH_SIZE_10000_LESS 0, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CTYPE_MULTIPART_NO_QUOTE 0, DKIM_SIGNATURE 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, REFERENCES 0, SPF_PASS 0, URI_ENDS_IN_HTML 0, WEBMAIL_SOURCE 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_ALT 0, __DATE_TZ_RU 0, __DQ_NEG_HEUR 0, __DQ_NEG_IP 0, __FORWARDED_MSG 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_FROM 0, __HAS_HTML 0, __HAS_MSGID 0, __HELO_GMAIL 0, __HEX28_LC_BOUNDARY 0, __HTML_AHREF_TAG 0, __HTML_TAG_DIV 0, __HTTPS_URI 0, __IN_REP_TO 0, __MIME_HTML 0, __MIME_TEXT_H 0, __MIME_TEXT_H1 0, __MIME_TEXT_H2 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_TEXT_P2 0, __MIME_VERSION 0, __MULTIPLE_URI_HTML 0, __MULTIPLE_URI_TEXT 0, __PHISH_SPEAR_HTTP_RECEIVED 0, __PHISH_SPEAR_STRUCTURE_1 0, __RATWARE_SIGNATURE_3_N1 0, __RDNS_GMAIL 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NOT_IMG 0, __URI_NO_WWW 0, __URI_NS , __URI_WITHOUT_PATH 0, __URI_WITH_PATH 0, __YOUTUBE_RCVD 0, __zen.spamhaus.org_ERROR '
X-Spam-Level:
X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2017.4.3.95417
To: bug-DBD-Pg [...] rt.cpan.org
X-GM-Message-State: AFeK/H032WD0YUf/y6NlscZZy6ac+fe/6tXKNu8pw/WZPCWgDaHNVAem6S/o59q11jTtc55eKSjbq4TqikikrQ==
From: Dmitry Shalashov <skaurus [...] gmail.com>
RT-Message-ID: <rt-4.0.18-28446-1491213803-1222.109244-0-0 [...] rt.cpan.org>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 622
Download (untitled) / with headers
text/plain 622b
Thanks, Greg! Dmitry Shalashov, surfingbird.ru & relap.io 2017-04-03 5:17 GMT+03:00 Greg Sabino Mullane via RT <bug-DBD-Pg@rt.cpan.org Show quoted text
>:
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=109244 > > >
> > I hesitate calling DB directly like this: > > $dbh->do('BEGIN READ ONLY'); > > $dbh->do('SELECT pg_sleep(15)); > > $dbh->do('COMMIT'); > > because DBD::Pg have a lot going under its hood and I feel kinda insecure > > missing all this. Maybe I'm wrong here?
> > I think you should be fine using do() like that. It is difficult to see > how we would extend $dbh->begin_work() anyway, as it's a DBI method. > > > >
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 1426


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.