[GENERAL] Performance options for CPU bound multi-SUM query

2016-01-24 Thread Matt
I have a warehousing case where data is bucketed by a key of an hourly timestamp and 3 other columns. In addition there are 32 numeric columns. The tables are partitioned on regular date ranges, and aggregated to the lowest resolution usable. The principal use case is to select over a range of

Re: [GENERAL] Performance options for CPU bound multi-SUM query

2016-01-27 Thread Matt
Moving from NUMERIC to FLOAT(8) did indeed lower query times by about 20%. I will try fixeddecimal and agg() as time permits. On 25 Jan 2016, at 4:44, David Rowley wrote: On 25 January 2016 at 15:45, Matt wrote: I have a warehousing case where data is bucketed by a key of an hourly

Re: [GENERAL] Looking for Suggestion on Learning

2011-02-06 Thread Matt
On Sun, Feb 6, 2011 at 11:14 AM, ray joseph wrote: > Matt, > > > > Thank you for your insightful view. I do not have a design for any of my > design opportunities. This is one reason I was looking for a design tool. > I have many work processes that are inter related, g

Re: [GENERAL] Web Hosting

2011-03-07 Thread Matt
Thanks, but I tried that originally and the companies that come up have either poor ratings, won't support postgres, won't allow me the freedom to run my own software, or after talking with them I realized there was PEBKAC issues with there support staff. I also, as stated earlier, won't go with t

Re: [GENERAL] Complex Recursive Query

2014-07-23 Thread matt
I wouldn't do this with recursion; plain old iteration is your friend (yes, WITH RECURSIVE is actually iterative, not recursive...) The algorithm goes like this: 1. Extend your graph relation to be symmetric and transitive. 2. Assign a integer group id to each node. 3. Repeatedly join the node li

[GENERAL] Table checksum proposal

2014-07-23 Thread matt
I have a suggestion for a table checksumming facility within PostgreSQL. The applications are reasonably obvious - detecting changes to tables, validating data migrations, unit testing etc. A possible algorithm is as follows: 1. For each row of the table, take the binary representations of the v

Re: [GENERAL] Table checksum proposal

2014-07-24 Thread matt
> On Thu, Jul 24, 2014 at 3:35 AM, wrote: > >> I have a suggestion for a table checksumming facility within PostgreSQL. >> The applications are reasonably obvious - detecting changes to tables, >> validating data migrations, unit testing etc. A possible algorithm is >> as >> follows: >> >> 1. For

Re: [GENERAL] regex help wanted

2013-04-28 Thread matt
> On 2013-04-25, Karsten Hilbert wrote: >> On Thu, Apr 25, 2013 at 10:32:26AM -0400, Tom Lane wrote: >> >>> Karsten Hilbert writes: >>> > What I don't understand is: Why does the following return a >>> > substring ? >>> >>> > select substring ('junk $$ junk' from >>> '\$<[^<]+?::[^:]+?>\$'); >>

[GENERAL] INSERT/UPDATE statements sometimes choosing not to use PK index?

2013-10-28 Thread Matt
I have a relatively simple data load script, which upserts (UPDATE existing rows, INSERT new rows), which should be supported by the primary key index, the only index on this table: UPDATE destination SET ... FROM staging WHERE staging.pk = destination.pk; INSERT INTO destination SELECT ..

Re: [GENERAL] INSERT/UPDATE statements sometimes choosing not to use PK index?

2013-10-29 Thread Matt
worse, even though the explain plans appear identical: INSERT INTO destination (…) SELECT (…) FROM staging LEFT JOIN destination ON destination.id = staging.id WHERE destination.id IS NULL On 29 Oct 2013, at 9:45, Tom Lane wrote: > Matt writes: >> In most cases, EX

Re: [GENERAL] Clone database using rsync?

2013-11-05 Thread matt
e the production server offline. If you go with the folder copy and your installation has postgresql.conf, pg_hba.conf and so on in your data folder, you'll probably want to edit them after the copy - more logging, different security etc. Matt > I need to clone production database to develo

[GENERAL] Maintaining state across function calls

2012-11-19 Thread matt
make the ffunc do the garbage collection, which should prevents leakage altogether. Is this a reasonable thing to do? What are the risks? Is there a more "best-practice" way to achieve the same result? Many thanks, Matt -- Sent via pgsql-general mailing list (pgsql-general@postgres

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread matt
the Pg source code. Thanks for your reply. A follow-up question: to use the palloc/pfree functions with a C++ STL container, do I simply give the container an allocator which uses palloc and pfree instead of the default allocator, which uses new and delete? Matt -- 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] Maintaining state across function calls

2012-11-19 Thread matt
> m...@byrney.com writes: >> The question is: what's the "best practice" way of letting a >> C/C++-language function hang onto internal state across calls? > > A static variable for that is a really horrid idea. Instead use > fcinfo->flinfo->fn_extra to point to some workspace palloc'd in the > ap

[GENERAL] tuples

2008-12-05 Thread MatT
re an easy way to do this? regards, Matt Wirus Filipiński znowu atakuje http://klik.wp.pl/?adr=http%3A%2F%2Fprorocznia.pl%2Ff.html%3Fi%3D37160O-937882398O0&sid=575 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To m

[GENERAL] parse tree in XML format

2009-12-28 Thread matt
Is there some way to export the postgresql query parse tree in XML format? I can not locate the API/Tool etc to do that... thanks -Matt -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

Re: [GENERAL] tuples

2008-12-11 Thread MatT
count >> footer, but would print column names. >> >> is there an easy way to do this? >Start psql with the -P footer switch. 8.3.3 works this way. > >Allan Works:) Thx a lot! Regards Matt -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To ma

[GENERAL] Bash script to update sequences

2005-09-08 Thread Matt
newval=`echo $updateseq | psql -t ${database} | sed -e 's/ //g'` echo "Table $table: $idfield has sequence: $i, with max value: $tablecount, updated to $newval" done - Hopefully this may solve someone some grief. Cheers, Matt ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] PL/pgsql - getting row from record

2004-11-16 Thread Matt
FOR srow IN EXECUTE ''SELECT '' || col || '' AS scol FROM get_colval_from_record_tmp'' LOOP colval := srow.scol; END LOOP; DROP TABLE get_colval_from_record_tmp; Thanks for the help, Matt BTW: I noticed on http://developer.pos

Re: [GENERAL] OID's

2004-11-16 Thread Matt
Hi, > > > > OIDS are a system level implementation. They are no longer required > > > > (you can make tables without OIDS) and they may go away someday. What about tableoids? Are they from the same generator as row oids (and hence may suffer wrap-around)? Or are they unique across the db? I ask

Re: [GENERAL] PL/pgsql - getting row from record

2004-11-16 Thread Matt
Thanks for the quick response! > Really, you'd be better off using one of the more interpreted languages > for this specific task though. Was afraid someone would say that. Time to polish up those tarnished perl skills ;) Matt ---(end o

Re: [GENERAL] OID's

2004-11-16 Thread Matt
> How do you make use of this? It seems like you would need your code to know > which foreign_oid referred to which table to actually perform the join. Sorry, wasn't very clear about what it does: select * from mytable t left join joinme j on t.id = j.foreign_id and t.tableoid = j.foreign_oid;

Re: [GENERAL] How to make a good documentation of a database ?

2004-11-18 Thread Matt
e used them (just coming back to postgres after enforced exile in mysqlville) but last I checked: http://gborg.postgresql.org/project/dbutils/ Could generate UML diagrams from your DB. You might still be stuck diff-ing them when you change the db, but at least they're prettier than pg-dump. Matt

Re: [GENERAL] phpPgAdmin problem - this list?

2004-11-19 Thread Matt
mment the extension=pgsql.so line). Matt ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Matt
> Especially since PostgreSQL has no fixed length string types, so > following that advice would exclude any strings. That's kind of > useless. char(n) ? ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Matt
> Latin-9 5 bytes > UTF-8 6 bytes > UTF-16 10 bytes > > But it should still fit in a char(5), wouldn't you agree? Got you. > In postgresql there is no difference in storage method between text, > varchar(n) and char(n). Learn something ne

[GENERAL] FATAL Error

2006-08-07 Thread Matt
TEXT: writing block 3421 of relation 1663/9533957/9534098 but I can connect using psql DBNAME Any insight other than restore from your most recent backup? Thanks, Matt ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] returning value from inside a transaction

2001-09-14 Thread Matt
function inside the transaction a wrapper like this is the only way I can see to lock tables a 'plpgsql' function updates. "Functions and trigger procedures are always executed within a transaction established by an outer query" so how on earth do i do this and find out what

[GENERAL] Import Database

2001-02-05 Thread Matt
takes less than an hour, however sometimes crashes. Is postgresql likely to be faster or slower at importing such vast amounts of data? Matt

[GENERAL] pg_upgrade failing from 9.3 to 9.4 because "template0" already exists

2015-03-06 Thread Matt Landry
Attempting to upgrade a large (>3TB) postgressql database from 9.3 to 9.4 on Ubuntu 14.04 LTS, but the process fails fairly early on. The error message instructs me to look at the last few lines of pg_upgrade_utility.log for more info, and the last two lines there (the only ones that don't succ

Re: [GENERAL] pg_upgrade failing from 9.3 to 9.4 because "template0" already exists

2015-03-06 Thread Matt Landry
On 03/06/2015 12:37 PM, Adrian Klaver wrote: Agreed, I am just trying to figure out how you get: CREATE DATABASE "template0" WITH TEMPLATE = template0 .. Seems to be a snake eating its tail:) Yes. It does. And it's pretty obvious why having this would be a problem...not quite so obvious how

Re: [GENERAL] pg_upgrade failing from 9.3 to 9.4 because "template0" already exists

2015-03-06 Thread Matt Landry
On 03/06/2015 01:55 PM, Adrian Klaver wrote: So on the original cluster, log in using psql and do \l and post the results here. Thanks. [...] Meant to add to previous post, to check with issue that Stephen mentioned do: select datname, datallowconn from pg_database ; postgres=# \l

Re: [GENERAL] pg_upgrade failing from 9.3 to 9.4 because "template0" already exists

2015-03-06 Thread Matt Landry
On 03/06/2015 02:43 PM, Stephen Frost wrote: Right, as I mentioned, template0 shouldn't have datallowconn as 'true'. That's why it's being included in the pg_dumpall. On your test setup, run (as superuser): update pg_database set datallowconn = false where datname = 'template0'; Then re-run th

[GENERAL] expanded auto and header linestyle double

2017-11-15 Thread Matt Zagrabelny
Greetings, Using PG 10.1. In my .psqlrc I have: \x auto \pset linestyle 'unicode' \pset unicode_header_linestyle double and when the output is expanded, I do not see a double line for the first record, but I do for all subsequent records. For example: % select * from artist; ─[ RECORD 1 ]

Re: [GENERAL] expanded auto and header linestyle double

2017-11-16 Thread Matt Zagrabelny
Thanks for the reply, Pavel! On Thu, Nov 16, 2017 at 1:01 AM, Pavel Stehule wrote: > Hi > > 2017-11-15 23:37 GMT+01:00 Matt Zagrabelny : > >> Greetings, >> >> Using PG 10.1. >> >> In my .psqlrc I have: >> >> \x auto >> \pset linestyle

Re: [GENERAL] mild modification to pg_dump

2017-11-18 Thread Matt Zagrabelny
On Fri, Nov 17, 2017 at 3:58 PM, marcelo wrote: > Again: knowing of .pgpass (thank you Scott) this is what I will do. > > Just in case you might not know. The perms of the .pgpass file need to not have group or all write access. For instance: chmod 0600 .pgpass -m

[GENERAL] pg_resetxlog command not found

2007-06-18 Thread Matt Bartolome
missing the pg_xlog directory files? I find it odd that the pg_resetxlog command is just missing... I have postgres installed from source on my laptop and it is there. Thanks, Matt ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] pg_resetxlog command not found

2007-06-18 Thread Matt Bartolome
After poking around some more the command is located in /usr/lib/postgresql/8.1/bin/pg_resetxlog on ubuntu. On 6/18/07, Matt Bartolome <[EMAIL PROTECTED]> wrote: I am doing some experimentation with a WAL archiving HA setup. I tried turning to the pg_resetxlog command after removin

[GENERAL] Unsubscribe

2007-08-07 Thread Matt Starr
From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Merlin Moncure [EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 11:14 PM To: [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Move database from Solaris to Windows On 8/2/07

[GENERAL] can i use an array as a table (in the from clause)

2007-08-13 Thread Coarr, Matt
Is there some way that I can treat a two dimensional array as a table that can be referenced in the from clause? Thanks, Matt ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan

[GENERAL] SLOW Remote Connection to PostgreSQL Database

2007-10-04 Thread Matt White
Hello, I am running a Rails app on server1 that connects to dbserver where the database is. There is another server, server2, that connects to dbserver quickly and returns quickly no matter how high dbserver's load is. Doing "psql -h dbserver.domain.com database username" from server1 times out ev

[GENERAL] any way to query for current connections to db?

2007-11-09 Thread Coarr, Matt
Hi, Is there any way to query the database to identify what the current connections are (connections, sessions, or whatever you want to call them)? This would be something similar to oracle's v$session view. Thanks, Matt

[GENERAL] 8.3b2 XPath-based function index server crash

2007-11-18 Thread Matt Magoffin
Hello, I currently have a table in Postgres 8.1 with a text column that contains XML. I use the xml2 module to define several XPath-based function indices on that column, and this has worked very well. I'm trying not to evaluate the native XML support in 8.3b2. I dumped this table from 8.1, then l

Re: [GENERAL] 8.3b2 XPath-based function index server crash

2007-11-18 Thread Matt Magoffin
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Tom Lane) wrote: > "Matt Magoffin" <[EMAIL PROTECTED]> writes: > > So I explored with a SELECT statement, thinking there was some specific > > XML document causing the crash. I could consistently exec

Re: [GENERAL] 8.3b2 XPath-based function index server crash

2007-11-18 Thread Matt Magoffin
> On Mon, Nov 19, 2007 at 10:02:20AM +1300, Matt Magoffin wrote: >> Sorry if I left any relavent details out. I've been looking at this for >> a while so many things are probably obvious only to me. Could you hint >> at which additional details you think would be use

Re: [GENERAL] 8.3b2 XPath-based function index server crash

2007-11-18 Thread Matt Magoffin
> "Matt Magoffin" <[EMAIL PROTECTED]> writes: >> I understand. I cannot make the SELECT query nor the ADD INDEX command >> break on an empty database. I cannot share this database data, either. > > So try to make a test case using dummy data, or with suitably

Re: [GENERAL] 8.3b2 XPath-based function index server crash

2007-11-18 Thread Matt Magoffin
> "Matt Magoffin" <[EMAIL PROTECTED]> writes: >> (gdb) bt >> #0 0x8820 in __memcpy () >> #1 0x004d9098 in xmlBufferAdd () >> #2 0x004e0dc4 in xmlParserInputBufferCreateMem () >> #3 0x004ced98 in xmlCtxtReadMemory () >> #4 0x0026ea0c

Re: [GENERAL] 8.3b2 XPath-based function index server crash

2007-11-18 Thread Matt Magoffin
> "Matt Magoffin" <[EMAIL PROTECTED]> writes: >> (gdb) bt >> #0 0x8820 in __memcpy () >> #1 0x004d9098 in xmlBufferAdd () >> #2 0x004e0dc4 in xmlParserInputBufferCreateMem () >> #3 0x004ced98 in xmlCtxtReadMemory () >> #4 0x0026ea0c

Re: [GENERAL] 8.3b2 XPath-based function index server crash

2007-11-18 Thread Matt Magoffin
>>> (gdb) bt >>> #0 0x8820 in __memcpy () >>> #1 0x004d9098 in xmlBufferAdd () >>> #2 0x004e0dc4 in xmlParserInputBufferCreateMem () >>> #3 0x004ced98 in xmlCtxtReadMemory () >>> #4 0x0026ea0c in xpath (fcinfo=0x37) at xml.c:3183 >>> #5 0x001095bc in ExecMakeFunctionResultNoSets (fcache=

Re: [GENERAL] 8.3b2 XPath-based function index server crash

2007-11-18 Thread Matt Magoffin
> "Matt Magoffin" <[EMAIL PROTECTED]> writes: >> I took the latest snapshot from /dev, but I still get the same crash: > > Drat :-(. Please try a bit harder at generating a self-contained > test case. Given where the crash is happening, I suspect it may be &g

[GENERAL] possible to create multivalued index from xpath() results in 8.3?

2007-11-18 Thread Matt Magoffin
I've working with XML in Postgres 8.3 and am trying to find a way to create a text-based index from an XPath that returns multiple nodes. For example, if I have an XPath like /[EMAIL PROTECTED]"mykey"]/text() which might return a few text nodes like value1 value2 value3 I'd like 3 index values

Re: [GENERAL] possible to create multivalued index from xpath() results in 8.3?

2007-11-19 Thread Matt Magoffin
> "Matt Magoffin" <[EMAIL PROTECTED]> writes: >> 2) Even if I could have an xpath() result return an array with multiple >> values, like {value1,value2,value3} I wasn't able to define a GIN index >> against the xml[] type. Should this be possible? >

Re: [GENERAL] possible to create multivalued index from xpath() results in 8.3?

2007-11-20 Thread Matt Magoffin
> AFAICT that's exactly what it does. > > regression=# select xpath('//[EMAIL PROTECTED]"mykey"]/text()', > 'ABC key="mykey">XYZRSTDEF'); >xpath > --- > {XYZ,RST} > (1 row) > > regression=# > > Of course this is of type xml[], but you can cast to text[] and then > index. Ugh, you're

Re: [GENERAL] replication in Postgres

2007-11-26 Thread Matt Magoffin
> So what is the state-of-the-art in the Postgresql world if I _do_ want > synchronous replication? 2-phase commit from the client application? Any > success/horror stories about doing it in Java? For Java, you could check out Sequoia (http://sequoia.continuent.org/) or their commercial version un

[GENERAL]

2007-11-28 Thread Matt Doughty
nt to select is always called the same (field_not_wanted, for example). I've been told that an array could work in this case but I'm not reallly sure about how to go about this. Cheers, Matt Matt Doughty GEOGRAMA S.L. Tel.: +34 945 13 13 72652 77 14

[GENERAL] Select all fields except one

2007-11-28 Thread Matt Doughty
nt to select is always called the same (field_not_wanted, for example). I've been told that an array could work in this case but I'm not reallly sure about how to go about this. Cheers, Matt Matt Doughty GEOGRAMA S.L. Tel.: +34 945 13 13 72652 77 14

[GENERAL] how to create aggregate xml document in 8.3?

2007-12-10 Thread Matt Magoffin
Hello, I'm trying to write a query to return an XML document like ... I started with select xmlelement(name range, xmlattributes(m.range, count(s.id) as "count")) from mb_sale s inner join mb_lead m on m.sale_id = s.id where s.sale_date >= date('2007-08-01') and s.sale_date <=

[GENERAL] psql batch file question

2007-12-11 Thread Matt Doughty
command or the other. Has anybody got any ideas? Thanks! Matt PS. Below I've copied the current state of the bat. rem %1 database - %2 scheme echo. IF \x \\select count(*) from function01('%2', '[table]') | psql %1 [user_name]==DATA goto d

Re: [GENERAL] how to create aggregate xml document in 8.3?

2007-12-11 Thread Matt Magoffin
> "Matt Magoffin" <[EMAIL PROTECTED]> writes: >> Hello, I'm trying to write a query to return an XML document like >> >> >> >> ... >> > > Something like this: > > regression=# select xmlelement(name root, xmlag

Re: [GENERAL] how to create aggregate xml document in 8.3?

2007-12-11 Thread Matt Magoffin
> "Matt Magoffin" <[EMAIL PROTECTED]> writes: >> Thanks very much, that helps. Now I'm wondering if it's also possible to >> then fill in another nested element level in the XML output, from the >> rows >> that are aggregated into the c

[GENERAL] Many 8.3 server crashes in xmlCleanupCharEncodingHandlers()

2007-12-17 Thread Matt Magoffin
Hello, I'm using 8.3b4 and keep experiencing server crash when I execute various queries using XML functions. The crash backtraces look like this: --- Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x3f847ae1 0x004b140c in xmlCleanupCharEn

Re: [GENERAL] Many 8.3 server crashes in xmlCleanupCharEncodingHandlers()

2007-12-17 Thread Matt Magoffin
> This was reported before, > http://archives.postgresql.org/pgsql-general/2007-12/msg00716.php > but neither he nor you have provided anything approximating a > reproducible test case. The interactions with libxml are messy > enough that I'm not even going to think about fixing this without > a t

Re: [GENERAL] Many 8.3 server crashes in xmlCleanupCharEncodingHandlers()

2007-12-17 Thread Matt Magoffin
> Not sure --- when are you thinking of, and what was the context? > I don't usually keep sample data unless the issue still seems open. I was referring to a dump I provided a link to you called "pg83-leads-sanitized.db" which was around 20 Dec, with email subject "Re: [GENERAL] 8.3b2 XPath-based

[GENERAL] Way to avoid expensive Recheck Cond in index lookup?

2007-12-18 Thread Matt Magoffin
Hello, I'm trying to find a way to use a text[] index lookup using an xpath() function in 8.3, but I suspect this situation is not specific to 8.3 or this exact query style. The query plan looks like Bitmap Heap Scan on lead (cost=37.39..7365.22 rows=2206 width=8) Recheck Cond: ((xpath('/als:

Re: [GENERAL] Way to avoid expensive Recheck Cond in index lookup?

2007-12-18 Thread Matt Magoffin
>> The problem for me is, the Recheck Cond is then on the xpath() function >> used by the function-based index. My understanding is that then the >> database must actually call the xpath() function again on all matches >> from >> the index lookup. > > This is mistaken. It only happens if there are

Re: [GENERAL] Way to avoid expensive Recheck Cond in index lookup?

2007-12-19 Thread Matt Magoffin
> But it's true that it's possible for a slow expression to make the recheck > very expensive. The planner doesn't have a very good understanding of how > to > tell whether the expression is likely to be slow. > > The case I ran into is thing like "WHERE x = ANY $1::integer[]" which > become > very

[GENERAL] Tools for partitioning and query optimization

2010-10-19 Thread Matt Harrison
N ANALYZE output and make somewhat intelligent suggestions. Any feedback is appreciated. Hopefully these tools are useful to others. cheers, matt 0 - http://github.com/mattharrison/PgPartition 1 - http://github.com/mattharrison/PgTweak

[GENERAL] A few [Python] tools for postgres

2010-11-01 Thread Matt Harrison
N ANALYZE output and make somewhat intelligent suggestions. Any feedback is appreciated. Hopefully these tools are useful to others. I'll be at PgWest this week, if anyone wants to discuss these (or pgtune, or python, etc) cheers, matt http://panela.blog-city.com/ 0 - http://github.com/m

[GENERAL] Full Text Index Scanning

2011-01-28 Thread Matt Warner
o_tsvector(colname) @@ to_tsquery('%part_of_word%')" The reason I want to do this is that the partial word search does not involve dictionary words (it's scanning names). Is this something Postgres can do? Or is there a different way to do scan the index? TIA, Matt

Re: [GENERAL] Full Text Index Scanning

2011-01-29 Thread Matt Warner
Thanks Oleg. I'm going to have to experiment with this so that I understand it better. Matt On Fri, Jan 28, 2011 at 1:12 PM, Oleg Bartunov wrote: > Matt, I'd try to use prefix search on original string concatenated with > reverse string: > > Just tried on some sp

Re: [GENERAL] Full Text Index Scanning

2011-01-29 Thread Matt Warner
nt. Is there a specific version of the reverse function you're using? Or am I just missing something obvious? This is Postgres 9, BTW. Thanks, Matt On Sat, Jan 29, 2011 at 6:46 AM, Matt Warner wrote: > Thanks Oleg. I'm going to have to experiment with this so that I understand &g

Re: [GENERAL] Full Text Index Scanning

2011-01-29 Thread Matt Warner
9.0.2 On Sat, Jan 29, 2011 at 9:35 AM, Oleg Bartunov wrote: > What version of Pg you run ? Try latest version. > > Oleg > > > On Sat, 29 Jan 2011, Matt Warner wrote: > > Reverse isn't a built-in Postgres function, so I found one and installed >> it. >>

Re: [GENERAL] Full Text Index Scanning

2011-01-30 Thread Matt Warner
1) || reverse(substring($1, 1, > length($1)-1)) > > else '' end $$ language sql immutable strict; > > > > On Sat, 29 Jan 2011, Matt Warner wrote: > > 9.0.2 >> >> On Sat, Jan 29, 2011 at 9:35 AM, Oleg Bartunov wrote: >> >> What v

Re: [GENERAL] Full Text Index Scanning

2011-01-30 Thread Matt Warner
Aha! Thanks for pointing that out. It's indexing now. Thanks! Matt On Sun, Jan 30, 2011 at 9:12 AM, Tom Lane wrote: > Matt Warner writes: > > Doesn't seem to work either. Maybe something changed in 9.1? > > create index test_idx on testtable using gin(to_tsvector(wor

Re: [GENERAL] Full Text Index Scanning

2011-01-30 Thread Matt Warner
If I understand this, it looks like this approach allows me to match the beginnings and endings of words, but not the middle sections. Is that correct? That is, if I search for "jag" I will find "jaeger" but not "lobenjager". Or am I (again) not understanding how t

Re: [GENERAL] Full Text Index Scanning

2011-01-30 Thread Matt Warner
ot;gist" STATEMENT: create index test_idx on test using gist(columnname gist_trgm_ops); ERROR: operator class "gist_trgm_ops" does not exist for access method "gist" On Sun, Jan 30, 2011 at 10:36 AM, Tom Lane wrote: > Matt Warner writes: > > If I understand

[GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
uot; for help. postgres=# select nvl(null,1); nvl - 1 (1 row) postgres=# \q TIA, Matt

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
It's a "contrib" module: http://pgfoundry.org/projects/orafce/ Matt On Fri, Mar 4, 2011 at 1:20 PM, John R Pierce wrote: > On 03/04/11 1:11 PM, Matt Warner wrote: > >> Good afternoon. >> >> I've been looking at the Oracle Functionality package.

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
To be clear, this is open source Postgres I'm using, not the enterprise product. Matt On Fri, Mar 4, 2011 at 1:29 PM, Matt Warner wrote: > It's a "contrib" module: > > http://pgfoundry.org/projects/orafce/ > > Matt > > > On Fri, Mar 4, 2011 at 1:20

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
the given name and argument types. You might need to add explicit type casts. On Fri, Mar 4, 2011 at 1:34 PM, Vibhor Kumar wrote: > > On Mar 5, 2011, at 2:50 AM, John R Pierce wrote: > > > On 03/04/11 1:11 PM, Matt Warner wrote: > >> Good afternoon. > >> > >>

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
Here's how the script is defining the function, if that helps: CREATE FUNCTION nvl(anyelement, anyelement) RETURNS anyelement AS '$libdir/orafunc','ora_nvl' LANGUAGE C IMMUTABLE; On Fri, Mar 4, 2011 at 1:41 PM, Matt Warner wrote: > No luck: > > *** as

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
On Fri, Mar 4, 2011 at 1:48 PM, Bosco Rama wrote: > Matt Warner wrote: > > No luck: > > > > *** as postgres > > postgres=# GRANT all on function nvl(anyelement,anyelement) to public; > > GRANT > > postgres=# > > > > *** as unprivileged user >

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
On Fri, Mar 4, 2011 at 1:49 PM, John R Pierce wrote: > On 03/04/11 1:41 PM, Matt Warner wrote: > >> No luck: >> >> *** as postgres >> postgres=# GRANT all on function nvl(anyelement,anyelement) to public; >> GRANT >> postgres=# >> >>

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
On Fri, Mar 4, 2011 at 1:51 PM, Andrew Sullivan wrote: > On Fri, Mar 04, 2011 at 01:41:34PM -0800, Matt Warner wrote: > > No luck: > > > > *** as postgres > > postgres=# GRANT all on function nvl(anyelement,anyelement) to public; > > GRANT > > post

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
On Fri, Mar 4, 2011 at 1:56 PM, Bosco Rama wrote: > Matt Warner wrote: > > > > The function cannot be defined in the user's DB because "language C" is > > considered a security risk, so only the superuser can do that. Or that's > > what I get

Re: [GENERAL] Unprivileged access to pgsql functions?

2011-03-04 Thread Matt Warner
On Fri, Mar 4, 2011 at 2:03 PM, John R Pierce wrote: > On 03/04/11 1:57 PM, Matt Warner wrote: > >> Not sure. I believe public and pg_catalog are in the path by default. Most >> of the create function declarations prepend pg_catalog, and I believe I saw >> somewher

[GENERAL] New Application Development Announcement

2011-03-24 Thread matt jones
://collectablesdb.net or github.com/CollectablesDB Matt

[GENERAL] pg_ident.hba on a single-user, multi-app machine

2014-08-16 Thread Matt Silverlock
Hi all. Trying to rationalise my pg_hba.conf and pg_ident.conf configuration on a Debian/Ubuntu machine where: * One primary application user (“deploy”) runs web applications * postgres, nginx, et. al run under their own users * Using a Unix socket for connecting to PostgreSQL on the same machin

Re: [GENERAL] Localhost vs. Unix Domain Sockets?

2014-08-18 Thread Matt S
I went through the same process a little while ago - worth reading is the pg_hba.conf documentation: http://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html Specifically: * Don't enable "trust" auth (i.e. any OS user as any DB user) - that's rarely what you want on a multi-user machine. *

Re: [GENERAL] Localhost vs. Unix Domain Sockets?

2014-08-18 Thread Matt S
> To put it another way, keeping the two sets of names distinct is incrementally more complex to manage. Which might be worth it if there really is any gain. Is this a "best practice," or is it really a manifestation of its closely-related cousin, the "silly practice?" :) It's ultimately up to y

[GENERAL] Deploying PostgreSQL on CentOS with SSD and Hardware RAID

2013-05-10 Thread Matt Brock
d this specific hardware setup in order to have experience with these general issues. The P420i controller appears to be compatible with recent versions of CentOS, so drivers should not be a concern (hopefully). Any insights anyone can offer on these issues would be most welcome. Regards, Mat

Re: [GENERAL] Deploying PostgreSQL on CentOS with SSD and Hardware RAID

2013-05-10 Thread Matt Brock
13 at 9:14 AM, Matt Brock wrote: >> Hello. >> >> We're intending to deploy PostgreSQL on Linux with SSD drives which would be >> in a RAID 1 configuration with Hardware RAID. >> >> My first question is essentially: are there any issues we need to be aware &

Re: [GENERAL] Deploying PostgreSQL on CentOS with SSD and Hardware RAID

2013-05-11 Thread Matt Brock
oesn't appear to be available on the HP website - hopefully it will be forthcoming at some point. Matt. -- 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] Deploying PostgreSQL on CentOS with SSD and Hardware RAID

2013-05-16 Thread Matt Brock
to all who've contributed their thoughts and opinions - much appreciated. Matt. On 13 May 2013, at 14:49, Merlin Moncure wrote: > On Sun, May 12, 2013 at 8:20 PM, John R Pierce wrote: >> On 5/12/2013 6:13 PM, David Boreham wrote: >>> >>> >>> Not quite.

[GENERAL] Differences in Unicode handling on Mac vs Linux?

2013-06-02 Thread Matt Daw
Mac). Anything else I could double-check? Or are there any known Mac-related Unicode issues? Thanks! Matt -- 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] Differences in Unicode handling on Mac vs Linux?

2013-06-02 Thread Matt Daw
relation "asset_sg_kdo_d�l�assigned_to__connections" does not exist \d produces: public | asset_sg_kdo_děláassigned_to__connections | table| matt For the short term, I think I'll boot up a Linux VM to troubleshoot my production bug... but I'll submit a bug report with repro steps.

[GENERAL] Question about using AggCheckCallContext in a C function

2013-08-12 Thread Matt Solnit
what's the best way to solve this problem? I would appreciate any help you can offer. Sincerely, Matt Solnit -- 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] Question about using AggCheckCallContext in a C function

2013-08-12 Thread Matt Solnit
On Aug 12, 2013, at 11:53 AM, Tom Lane wrote: > Matt Solnit writes: >> After poring over the code in nodeAgg.c, and looking at the in8inc() >> function, I think I know what the problem is: the typical use of >> AggCheckCallContext() is not compatible with TOAST-able da

Re: [GENERAL] Question about using AggCheckCallContext in a C function

2013-08-13 Thread Matt Solnit
On Aug 12, 2013, at 12:47 PM, Tom Lane wrote: > Matt Solnit writes: >> 2. The function seems to work consistently when I do a SELECT >> SUM(mycol) without any GROUP BY. It's only when I add grouping that >> the failures happen. I'm not sure if this is

[GENERAL] Cumulative (Running) Sum

2008-03-08 Thread Matt Culbreth
person. We want to query this table and show both a month's sales AND the cumulative sum for that person. Something like this: MONTH PERSON VALUE CUMULATIVE_SUM -- -- JanuaryDavid50 50 January

  1   2   3   >