Re: [GENERAL] PLPerl Trigger to update text search

2015-07-31 Thread Alex Hunsaker
On Fri, Jul 31, 2015 at 7:15 PM, Alex Hunsaker bada...@gmail.com wrote: $_TD-{new}{text_search} = spi_exec_query(to_tsvector('pg_catalog.english', . quote_literal('text1 text2') .;)-{rows}[0]{to_tsvector}; Err that should be: (still untested, was missing the select bit) $_TD-{new

Re: [GENERAL] PLPerl Trigger to update text search

2015-07-31 Thread Alex Hunsaker
On Fri, Jul 31, 2015 at 6:07 AM, Alex Magnum magnum11...@gmail.com wrote: Hi, I am trying to update a tsvector field through a plperl trigger. $_TD-{new}{text_search} = to_tsvector('pg_catalog.english', 'text1 text2'); You need to wrap that into an actual SPI call at the very least.

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-01-30 Thread Alex Hunsaker
On Fri, Jan 30, 2015 at 9:54 AM, Day, David d...@redcom.com wrote: Alan, I tried as you suggested, I believe the gdb debugger is giving some false indication about threads. Whether I attach to a newly launched backend or a backend that has been executing the suspect perlu function.

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-01-29 Thread Alex Hunsaker
On Thu, Jan 29, 2015 at 8:40 AM, Tom Lane t...@sss.pgh.pa.us wrote: Day, David d...@redcom.com writes: I am amending the info threads info there are two threads. Well, that's your problem right there. There should never, ever be more than one thread in a Postgres backend process: none of

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-01-29 Thread Alex Hunsaker
On Thu, Jan 29, 2015 at 1:54 PM, Day, David d...@redcom.com wrote: Thanks for the inputs, I’ll attempt to apply it and will update when I have some new information. BTW a quick check would be to attach with gdb right after you connect, check info threads (there should be none), run the

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-01-28 Thread Alex Hunsaker
On Wed, Jan 28, 2015 at 1:23 PM, Day, David d...@redcom.com wrote: It has been some time since we have seen this problem. See earlier message on this subject/thread for the suspect plperl function executing at the time of the core. Someone on our development team suggested it might

Re: [GENERAL] pl/perl and recent perl versions - failing to load internal modules

2014-07-01 Thread Alex Hunsaker
On Mon, Jun 30, 2014 at 7:47 PM, Toby Corkindale toby.corkind...@strategicdata.com.au wrote: Hi, I've been trying out PostgreSQL 9.3 with pl/perl built against Ubuntu 14.04 LTS' Perl 5.18 (Sourced from apt.postgresql.org) Maybe I'm doing something wrong, but it appears that plperl has

Re: [GENERAL] pl/perl and recent perl versions - failing to load internal modules

2014-07-01 Thread Alex Hunsaker
On Tue, Jul 1, 2014 at 6:39 PM, Toby Corkindale toby.corkind...@strategicdata.com.au wrote: Hi Alex, your example (chr(0x100) =~ /\\xa9/) works on my instance (pg 9.3.4, plperl 5.18) However the following code fails: = do $$ \N{U+263A} =~ /[[:punct:]]/$$ language plperl; ERROR: Unable to

Re: [GENERAL] pl/perl and recent perl versions - failing to load internal modules

2014-07-01 Thread Alex Hunsaker
On Tue, Jul 1, 2014 at 7:31 PM, Alex Hunsaker bada...@gmail.com wrote: On Tue, Jul 1, 2014 at 6:39 PM, Toby Corkindale toby.corkind...@strategicdata.com.au wrote: Hi Alex, However the following code fails: = do $$ \N{U+263A} =~ /[[:punct:]]/$$ language plperl; ERROR: Unable to load utf8

Re: [GENERAL] Case insensitive collation

2013-01-18 Thread Alex Hunsaker
On Fri, Jan 18, 2013 at 6:13 AM, Marcel van Pinxteren marcel.van.pinxte...@gmail.com wrote: Desired behaviour: 1. If there is a row with 'ABC' (in a unique column) in the table, a row with 'abc' should not be allowed 2. If I do SELECT * FROM aTable WHERE aColumn = 'ABC', I should see a row

Re: [GENERAL] OOM Killer / PG9 / RHEL 6.1

2011-11-02 Thread Alex Hunsaker
On Wed, Nov 2, 2011 at 10:42, David Kerr d...@mr-paradox.net wrote: Howdy, just a quick check, is vm.overcommit_memory = 2 vm.swappiness = 0 Still the way to go with PG9.0 / RHEL 6.1 (64bit) ? IMHO yes (although I never touch swappiness...) I know we gained some control over the OOM

Re: [GENERAL] plperlu function caused a segmentation fault

2011-08-24 Thread Alex Hunsaker
On Wed, Aug 24, 2011 at 12:32, bricklen brick...@gmail.com wrote: On Wed, Aug 24, 2011 at 11:28 AM, Tom Lane t...@sss.pgh.pa.us wrote: I wonder if there is something wonky about your Perl installation. I tested originally on two other 9.0.4 databases and there were no issues at all. I'll have

Re: [GENERAL] OSX Postgres PL/Perl Problem with Finance::Quote/Options

2011-03-30 Thread Alex Hunsaker
2011/3/30 Peter Pan ganbar...@hotmail.com: ... Unfortunately none at all, it just fails during the fetch and can't find any error messages anywhere. As stated, the same module works without problems in a local separate perl script. Any ideas? Skimming the source of Finance::Quote::Yahoo::USA

Re: [GENERAL] database is bigger after dump/restore - why? (60 GB to 109 GB)

2011-02-24 Thread Alex Hunsaker
On Thu, Feb 24, 2011 at 14:11, Aleksey Tsalolikhin atsaloli.t...@gmail.com wrote: are you truncating the table before restoring, or is this a restore into a new database, or what? I've tried both.  Slony truncates the table before copying it over, and I've tryind pg_restore'ing it into a new

Re: [GENERAL] reindexing

2011-02-07 Thread Alex Hunsaker
On Mon, Feb 7, 2011 at 17:12, akp geek akpg...@gmail.com wrote: Hi all -         I ran query this morning, I got a wrong results. I have run the same query in an other environment with same data and I got the result set I was expecting.        After that I did a re index and on the table I

Re: [GENERAL] reindexing

2011-02-07 Thread Alex Hunsaker
On Mon, Feb 7, 2011 at 17:28, akp geek akpg...@gmail.com wrote: thanks.. the index I was having is gist on a to_tsvector column . version we have is 8.3 What minor version? I sounds like you _could_ be hitting any of the below: - (8.3.14) Fix detection of page splits in temporary GiST indexes

Re: [GENERAL] plpythonu memory leak

2011-01-17 Thread Alex Hunsaker
On Fri, Jan 14, 2011 at 19:14, Daniel Popowich danielpopow...@gmail.com wrote: [ snip ] CREATE FUNCTION pygaps(start_ts timestamp without time zone, end_ts timestamp without time zone, gap_length interval) RETURNS SETOF timerange    LANGUAGE plpythonu    AS $$    # because pg passes

Re: [GENERAL] How to build plperl with PostgreSQL 9 on Windows

2011-01-05 Thread Alex Hunsaker
On Wed, Jan 5, 2011 at 05:49, tuanhoanganh hatua...@gmail.com wrote: I have error when build plperl 1-- Build started: Project: plperl, Configuration: Release Win32 -- 1Generate DEF file 1Not re-generating PLPERL.DEF, file already exists. 1Linking... 1   Creating library

Re: [GENERAL] How to build plperl with PostgreSQL 9 on Windows

2011-01-04 Thread Alex Hunsaker
On Tue, Jan 4, 2011 at 10:12, tuanhoanganh hatua...@gmail.com wrote: I has set config.pl to $config-{perl}; 1; I don't know anything about the windows build system, but shouldn't that be something like: $config-{perl} = 1; ? -- Sent via pgsql-general mailing list

Re: [GENERAL] How to build plperl with PostgreSQL 9 on Windows

2011-01-04 Thread Alex Hunsaker
On Tue, Jan 4, 2011 at 19:27, tuanhoanganh hatua...@gmail.com wrote: Thanks for answer me but it have error Detected Visual Studio version 8.00 Detected hardware platform: Win32 Generating win32ver.rc for src\backend Building src\pl\plperl\SPI.c... '1' is not recognized as an internal or

Re: [GENERAL] Plperl caching prepared queries and cleanup

2010-12-16 Thread Alex Hunsaker
On Thu, Dec 16, 2010 at 01:57, Anupama anupama...@gmail.com wrote: Will the plan be freed when the db session / connection closes OR Yes. However results may vary with a connection pooler. FYI %_SHARED is global to session, not database global. (technically its global per perl interpreter, so

Re: [GENERAL] MySQL - PostgreSQL conversion issue

2010-10-28 Thread Alex Hunsaker
On Thu, Oct 28, 2010 at 20:02, Scott Newton scott.new...@vadacom.co.nz wrote: On Fri, 29 Oct 2010 14:40:51 Tom Lane wrote: Anyway, you've got two different typing violations there, so you need two casts to fix it: Unfortunately not: from cc_call cdr left join cc_card cc on cdr.card_id=cc.id

Re: [GENERAL] Should PQconsumeInput/PQisBusy be expensive to use?

2010-10-27 Thread Alex Hunsaker
On Wed, Oct 27, 2010 at 15:02, Michael Clark codingni...@gmail.com wrote: Hello everyone. Upon some investigation I found that not calling PQconsumeInput/PQisBusy produces results in line with PQexecParams (which PQexecParams seems to be doing under the hood). (please keep in mind this is

Re: [GENERAL] Application user name attribute on connection pool

2010-08-02 Thread Alex Hunsaker
On Mon, Aug 2, 2010 at 07:30, rsmog...@softperience.pl wrote: Hello, I'm not member of this list, but because the 9th version of PostgreSQL is incoming, I would like to ask if there is possibility to add session property of application user Not for 9.0 its more or less already cut. - this

Re: [GENERAL] plpython feature idea: an option to return row results as lists

2010-07-30 Thread Alex Hunsaker
On Fri, Jul 30, 2010 at 15:45, Derek Arnold derek.arn...@dealerbuilt.com wrote: With result rows in plpython returned as dicts rather than lists, we ran into issues with a need to preserve the column order in the resultset. Interesting, +1 for the idea. plpy.execute( SELECT 1 as a, 2 as b,

Re: [GENERAL] Migrating from MySQL

2010-06-27 Thread Alex Hunsaker
On Sun, Jun 27, 2010 at 00:22, RP Khare passionate_program...@hotmail.com wrote: I want to migrate a production MySQL database to PostgreSQL. Is there any free tool that works effectively? I'd start here: http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#MySQL --

Re: [GENERAL] initdb fails on Centos 5.4 x64

2010-05-11 Thread Alex Hunsaker
On Mon, May 10, 2010 at 18:04, Tom Lane t...@sss.pgh.pa.us wrote: valentin.hoc...@kabelbw.de (Valentin Hocher) writes: [ cPanel's Shell Fork Bomb Protection actually does this: ]         ulimit -n 100 -u 20 -m 20 -d 20 -s 8192 -c 20 -v 20 2/dev/null Just to annotate that:

Re: [GENERAL] list of databases in C ? libpq ?

2010-05-07 Thread Alex Hunsaker
On Fri, May 7, 2010 at 11:18, Joao Ferreira gmail joao.miguel.c.ferre...@gmail.com wrote: Hello all, I need to write an application in C to read the list of databases currently in the server. very much like a psql -l... select datname as database from pg_database; but I need it in C ! I

Re: [GENERAL] Inheritance efficiency

2010-04-30 Thread Alex Hunsaker
On Fri, Apr 30, 2010 at 00:19, Vincenzo Romano vincenzo.rom...@notorand.it wrote: For example, the Linux kernel made the big jump with server hardware thanks also to the O(1) schedulers. flamebait Uhh linux has not had a O(1) scheduler since 2.6.23, its supposedly O(log n) now. =) /flamebait

Re: [GENERAL] Restricting the CREATEROLE privilege

2010-02-25 Thread Alex Hunsaker
On Thu, Feb 25, 2010 at 01:26, Wappler, Robert rwapp...@ophardt.com wrote: Good Morning, is there a way to limit the CREATEROLE privilege to a specific database? I currently set up an automated integration test environment. This includes a database owned by a specific user which should have

Re: [GENERAL] Restricting the CREATEROLE privilege

2010-02-25 Thread Alex Hunsaker
On Thu, Feb 25, 2010 at 08:22, Wappler, Robert rwapp...@ophardt.com wrote: Unfortunately, base_user inherits the connect privileges from role PUBLIC, regardless, whether it was created with NOINHERIT. Yeah, IMO the documentation does not really spell out that limitation. How about changing

Re: [GENERAL] How to get the permissions assigned to user?

2010-02-24 Thread Alex Hunsaker
On Tue, Feb 23, 2010 at 23:22, Jignesh Shah jignesh.shah1...@gmail.com wrote: Hi, Is there any way to get the set of permissions list assigned to user? I want to know whether user has create table permissions on particular schema or not? See

Re: [GENERAL] Sorting performance vs. MySQL

2010-02-23 Thread Alex Hunsaker
On Tue, Feb 23, 2010 at 00:02, Yang Zhang yanghates...@gmail.com wrote: Thing is, this is how I got here: - ran complex query that does SELECT INTO. - that never terminated, so killed it and tried a simpler SELECT (the subject of this thread) from psql to see how long that would take. You

Re: [GENERAL] Sorting performance vs. MySQL

2010-02-22 Thread Alex Hunsaker
On Mon, Feb 22, 2010 at 11:10, Yang Zhang yanghates...@gmail.com wrote: I have the exact same table of data in both MySQL and Postgresql. In ? Postgresql: FWIW on a stock (unchanged postgresql.conf) 8.3.9 I get (best of 3 runs) 79 seconds, 26 using an index and 27 seconds with it clustered.

Re: [GENERAL] Sorting performance vs. MySQL

2010-02-22 Thread Alex Hunsaker
On Mon, Feb 22, 2010 at 22:51, Yang Zhang yanghates...@gmail.com wrote: vmstat showed no swapping-out for a while, and then suddenly it started spilling a lot. Checking psql's memory stats showed that it was huge -- apparently, it's trying to store its full result set in memory. As soon as I

Re: [GENERAL] How to prevent duplicate key error when two processes do DELETE/INSERT simultaneously?

2009-07-29 Thread Alex Hunsaker
On Wed, Jul 29, 2009 at 19:53, Brodie Thiesfieldbrofield+pg...@gmail.com wrote: On further investigation, since the logic requires the delete to be made first to get rid of other possible rows, so I'll go with: DELETE (if supported)  INSERT OR REPLACE (otherwise)             INSERT, if

Re: [GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-19 Thread Alex Hunsaker
On Mon, Jan 19, 2009 at 09:48, Grzegorz Jaśkiewicz gryz...@gmail.com wrote: On Mon, Jan 19, 2009 at 4:43 PM, Tom Lane t...@sss.pgh.pa.us wrote: But having said that: 8.4 will provide a standard trigger that short-circuits vacuous updates, which you can apply to tables in which you think