Re: [GENERAL] pgfoundry

2007-02-24 Thread Matthew Peter
Chad Wagner <[EMAIL PROTECTED]> wrote: On 2/24/07, Matthew Peter <[EMAIL PROTECTED]> wrote: I was wondering if anyone new how to get this package to install for 8.2.3? When I try to install it I get: ERROR: incompatible library "/usr/lib/pgsql/uri.so": missing magic

[GENERAL] pgfoundry

2007-02-24 Thread Matthew Peter
I was wondering if anyone new how to get this package to install for 8.2.3? When I try to install it I get: ERROR: incompatible library "/usr/lib/pgsql/uri.so": missing magic block HINT: Extension libraries are required to use the PG_MODULE_MAGIC macro. I read 8.2 now needs the MAGIC definition

Re: [GENERAL] drive failre, corrupt data...

2007-01-18 Thread Matthew Peter
Wow. I just noticed I have the same problem today after a vacuum. As well as an degraded array. Musta been a time release Y2k7 bug. Hopefully didn't loose anything too important. Now that's room service! Choo

Re: [GENERAL] named cache

2006-12-02 Thread Matthew Peter
--- Shane Ambler <[EMAIL PROTECTED]> wrote: > Matthew Peter wrote: > > --- Willy-Bas Loos <[EMAIL PROTECTED]> wrote: > > > >> maybe you would find "materialized views" interesting. > >> http://www.google.com/search?q=materialized+view+post

Re: [GENERAL] named cache

2006-12-02 Thread Matthew Peter
--- Willy-Bas Loos <[EMAIL PROTECTED]> wrote: > maybe you would find "materialized views" interesting. > http://www.google.com/search?q=materialized+view+postgresql > > > On 12/1/06, Matthew Peter <[EMAIL PROTECTED]> wrote: > > > > Is it possibl

[GENERAL] named cache

2006-12-01 Thread Matthew Peter
Is it possible to put an query result into memory? Like SELECT * from table WHERE [...] CACHE cache_name TIMEOUT '1 hour'::interval; So if "cache_name" exists with the same SQL statement, the result would be fetched from the cache, refreshing and updating the cache with fresh results when it exp

[GENERAL] sequence help

2006-11-28 Thread Matthew Peter
I'll jump right in with an example create sequence foo start with 1; create view foobar as select *, nextval('foo') from bar; The problem is I need a nextval()-like method that returns the iterations without updating the foo sequence. Therefore, maintaining the sequences original value by star

Re: [GENERAL] RULE - special variables?

2006-11-09 Thread Matthew Peter
--- Richard Huxton wrote: > Matthew Peter wrote: > > Do rules get special variables like triggers? Can I set variables in them > > like > > triggers? > > You get NEW/OLD but they mean something subtly different. Rules act on a > query-tree so they are more lik

Re: [GENERAL] dblink / plpgsql - definition list cheats for record

2006-11-09 Thread Matthew Peter
--- Richard Huxton wrote: > Matthew Peter wrote: > > Is there any way to use CREATE TYPE or an VIEW/TABLE defintion list instead > > of > > manually defining it? > > Yes, just define your function as returning that type rather than > RECORD. That way the cal

[GENERAL] dblink / plpgsql - definition list cheats for record returning functions?

2006-11-08 Thread Matthew Peter
Is there any way to use CREATE TYPE/VIEW/TABLE defintion list instead of manually defining the result types in the calling sql? Thanks __ Sponsored Link Talk more and pay less. Vonage can save you up to

[GENERAL] TRIGGERS - access sql query_string that called it?

2006-11-08 Thread Matthew Peter
Is it possible to access the entire sql query_string that called the trigger? Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index --

[GENERAL] RULE - special variables?

2006-11-08 Thread Matthew Peter
Do rules get special variables like triggers? Can I set variables in them like triggers? Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail. http://new.mail.yahoo.com ---

[GENERAL] dblink / plpgsql - definition list cheats for record returning functions?

2006-11-08 Thread Matthew Peter
Is there any way to use CREATE TYPE or an VIEW/TABLE defintion list instead of manually defining it? Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail. http://new.mail.yahoo.com

[GENERAL] EXECUTE INSERT BUGS?

2006-11-06 Thread Matthew Peter
create table test (col text); create or replace function tester() RETURNS void AS $$ DECLARE cmd text; v_value text := null; -- ^^^ right here, NULL makes the querystring fail by setting cmd = null BEGIN cmd := 'INSERT INTO test ( col ) values ( '

Re: [GENERAL] select result / functions from another database in plpgsql

2006-11-06 Thread Matthew Peter
--- Richard Huxton wrote: > Matthew Peter wrote: > > I have DB1 and DB2 pg_databases... I then have a function in DB2 that > > wants some results from DB1, is it possible to query another db? Like > > how \! lets you hit the command line... but I need it in plpgsql if &g

[GENERAL] select result / functions from another database in plpgsql

2006-11-06 Thread Matthew Peter
I have DB1 and DB2 pg_databases... I then have a function in DB2 that wants some results from DB1, is it possible to query another db? Like how \! lets you hit the command line... but I need it in plpgsql if possible.Also, I know functions are local to db (unless it inserted into template1 prior to

[GENERAL] Automatic locale detection?

2006-10-08 Thread Matthew Peter
Is it possible to automatically detect the language encoding of incoming data? For instance if Japanese is used, is there a way to know it is Japanese from a bit in the charset, a dictionary-based evaluation or otherwise? All-new Yahoo! Mail - Fire up a more powerful email and get things done

Re: [GENERAL] increment row number function question

2006-10-07 Thread Matthew Peter
Thanks for the reply. <[EMAIL PROTECTED]><[EMAIL PROTECTED]>Even if such a function existed, it would almost certainly not do whatyou want in this query. Per SQL spec, the SELECT target list islogically supposed to be evaluated before the ORDER BY and LIMIT steps, which means you'd get numbers ass

[GENERAL] increment row number function question

2006-10-07 Thread Matthew Peter
Hello. I need a way to return an iterator result as a column eg,SELECT increment() as ii, some_col from some_tbl order by some_col desc limit 50; ii | some_col+--  1 |   zest  2 |   test  3 |   nest  4 |   fest[...]How can I acheive those results? Thanks for any help

Re: [GENERAL] Invoke diff from plpgsql?

2006-05-27 Thread Matthew Peter
George Pavlov <[EMAIL PROTECTED]> wrote: > Wondering how to invoke a application like diff from plpgsql? Thanks!And don't forget that you are working with a database. Most diff-inguses can probably be handled by constructs like EXCEPT and INTERSECT tosay nothing of OUTER JOINs. Also, IS DISTINCT F

[GENERAL] Invoke diff from plpgsql?

2006-05-26 Thread Matthew Peter
Wondering how to invoke a application like diff from plpgsql? Thanks! Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.

[GENERAL] column data size

2006-04-11 Thread Matthew Peter
wondering where to query for the physical size of a column (returned in bytes) in a row? i looked into the information_schema but i think that's more for getting triggers, views, etc. New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Re: [GENERAL] sort a referenced list

2006-04-04 Thread Matthew Peter
Tom Lane <[EMAIL PROTECTED]> wrote: Matthew Peter writes:> What I'm trying to do is create a function that accepts a list then sorts and groups the values (like in sql)... I will have an unique list I can convert it to an array later or leave it a listThere is no "list&quo

Re: [GENERAL] sort a referenced list

2006-04-04 Thread Matthew Peter
I'll help clarify exactly what I am trying to accomplish. What I'm trying to do is create a function that accepts a list then sorts and groups the values (like in sql)... I will have an unique list I can convert it to an array later or leave it a listI'd like to keep it simple and manipul

[GENERAL] pl/pgsql uniq varchar[] sort?

2006-04-03 Thread Matthew Peter
Hello list. I'm trying to get a unique, sorted varchar array in pl/pgsql. Essentially a "group by" and "order by"'d varchar[]. Anyone got any ideas or point me in the right direction? Thanks. New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Re: [GENERAL] Passing a list of values to a function

2006-01-09 Thread Matthew Peter
You could write the function to take an array of integers instead of a text string:CREATE OR REPLACE FUNCTION getlist(integer[]) RETURNS SETOF my_tbl as $$SELECT * FROM my_tblWHERE u_id = 0 OR u_id = ANY($1)$$ LANGUAGE SQL STABLE STRICT;SELECT * FROM getlist('{1,2,3}');Another way would be to bu

Re: [GENERAL] plpgsql question

2006-01-09 Thread Matthew Peter
Terminology point: you used the word "aggregate" but the function below doesn't have an aggregate. Aggregates are functions thatoperate on multiple rows, like count() and sum(); substr() doesn'tdo that so it's not an aggregate. ya. my mistake.[snip] 1. Create a composite type with the

Re: [GENERAL]

2006-01-09 Thread Matthew Peter
How come when I pass in a list in it doesn't use it as a list of integers? Do I need to somehow make $1 be interpreted as a list of ints? Rather than just passing a text value that contains the list?CREATE TABLE my_tbl (u_id int);INSERT INTO my_tbl (u_id) values (1);INSERT INTO my_tb

[GENERAL]

2006-01-09 Thread Matthew Peter
is using IN to query a list of values in an function supported? or is there a work around for this type of query?e.g. ... SELECT * FROM tbl WHERE u_id IN (0$1) $$ LANGUAGE SQL;  Yahoo! Photos Got holiday prints? See all the ways to get quality prints in your hands ASAP.

Re: [GENERAL] plpgsql question

2006-01-09 Thread Matthew Peter
snip WHERE my_tbl_id = $1AND CASE WHEN $2 IS NULL THEN TRUE ELSE $2 = username ENDor WHERE my_tbl_id = $1 AND COALESCE($2 = username, TRUE)or WHERE my_tbl_id = $1 AND COALESCE($2, username) = usernameWith predicates such as these you wouldn't need to use EXECUTE andyou could write the query

Re: [GENERAL] plpgsql question

2006-01-06 Thread Matthew Peter
Michael Fuhr <[EMAIL PROTECTED]> wrote: On Fri, Jan 06, 2006 at 01:14:38AM -0800, Matthew Peter wrote:> Michael Fuhr wrote:> > On Thu, Jan 05, 2006 at 12:50:34AM -0800, Matthew Peter wrote:> > > Is it possible to skip the loop and just return all records in a> >

Re: [GENERAL] plpgsql question

2006-01-06 Thread Matthew Peter
Michael Fuhr <[EMAIL PROTECTED]> wrote: On Thu, Jan 05, 2006 at 12:50:34AM -0800, Matthew Peter wrote:> Is it possible to skip the loop and just return all records in a> single query and shove all those rows into a table variable?Not in PL/pgSQL -- you need to return each row with

Re: [GENERAL] plpgsql question

2006-01-05 Thread Matthew Peter
On 1/5/06, Matthew Peter wrote: > I'm trying to do a simple SELECT * in plpgsql that returns a set of records > as a row w/ columns, not a row into a variable, w/ some conditionals. > > The function below is semi-pseudo with what I'm trying to... If anyone > coul

[GENERAL] plpgsql question

2006-01-04 Thread Matthew Peter
I'm trying to do a simple SELECT * in plpgsql that returns a set of records as a row w/ columns, not a row into a variable, w/ some conditionals. The function below is semi-pseudo with what I'm trying to... If anyone could give me an example that works by returning it as a resultset maintain

[GENERAL] inherits index

2006-01-02 Thread Matthew Peter
I have a parent table that is inherited by a couple others... Would it be best to set up an index on the children tables column that is inherited by the parent, or should I index the parent column that is inherited by the children? The children tables are the ones called frequently, not the par

Re: [GENERAL] How may I keep prepended array items positive?

2005-10-31 Thread Matthew Peter
to show output.. --- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Mon, Oct 31, 2005 at 04:37:39PM -0800, Matthew > Peter wrote: > > I would need to prepend a couple array items BUT I > > NEED them to be positive [1:13] instead of [-4:9] > for > > instance. > &

[GENERAL] How may I keep prepended array items positive?

2005-10-31 Thread Matthew Peter
I would need to prepend a couple array items BUT I NEED them to be positive [1:13] instead of [-4:9] for instance. How may I keep prepended array items positive? __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com

Re: [GENERAL] function example?

2005-10-30 Thread Matthew Peter
pg_native syntax. --- "A. Kretschmer" <[EMAIL PROTECTED]> wrote: > am 29.10.2005, um 20:39:23 -0700 mailte Matthew > Peter folgendes: > > Could someone help me and give me a basic example > of > > how to write a similiar functional function to the > one >

[GENERAL] function example?

2005-10-29 Thread Matthew Peter
Could someone help me and give me a basic example of how to write a similiar functional function to the one below that would use a dynamic table and update a column only if it held a value. I've been reading around and can't seem to find the answer I'm looking for. I just need a simple examle to

Re: [GENERAL] dynamic table naming in function

2005-10-29 Thread Matthew Peter
ol for the job. --- Tom Lane <[EMAIL PROTECTED]> wrote: > Matthew Peter <[EMAIL PROTECTED]> writes: > > Out of curiosity, I was wondering if it is > possible to > > use dynamic table names in a function? > > In plpgsql, you can do this by building dynamic

[GENERAL] dynamic table naming in function

2005-10-29 Thread Matthew Peter
Out of curiosity, I was wondering if it is possible to use dynamic table names in a function? AND whether or not you can test a value prior to insert to see whether or not you want to update that column. Where you could pass in the name of the table for it use ANY name passed in rather than statica

Re: [GENERAL] searching array

2005-10-17 Thread Matthew Peter
Let me also say that I'm retarded. No excuses from me. I'm officially retarded. --- Matthew Peter <[EMAIL PROTECTED]> wrote: > Thanks. That syntax didn't look right to find values > gte 1. But thanks everyone! > > > > --- Tom Lane <[EMAIL PROTE

Re: [GENERAL] searching array

2005-10-17 Thread Matthew Peter
I have it backwards huh? Since the variables are switched around in a ANY search I want a SELECT * FROM table WHERE arrcol >= 1 How do I write it to get those results? --- Tom Lane <[EMAIL PROTECTED]> wrote: > Matthew Peter <[EMAIL PROTECTED]> writes: > > Shouldn

Re: [GENERAL] searching array

2005-10-17 Thread Matthew Peter
Yes. I did read it wrong. I wanted to find all records that contained x where x >= 1 I am using ANY in my query on my test box I copied the ALL from example query in the docs, which still isn't working for me. --- Tom Lane <[EMAIL PROTECTED]> wrote: > Matthew Peter

Re: [GENERAL] searching array

2005-10-17 Thread Matthew Peter
Thanks. That syntax didn't look right to find values gte 1. But thanks everyone! --- Tom Lane <[EMAIL PROTECTED]> wrote: > Matthew Peter <[EMAIL PROTECTED]> writes: > > Yes. I did read it wrong. I wanted to find all > records > > that contained x where

Re: [GENERAL] searching array

2005-10-17 Thread Matthew Peter
Alright, what about with ANY? --- Joe Conway <[EMAIL PROTECTED]> wrote: > Matthew Peter wrote: > > Shouldn't >= also return Carols records since she > > contains records GREATER THAN 1? This is the > > problem I'm having, there's no errors, j

Re: [GENERAL] searching array

2005-10-17 Thread Matthew Peter
1? This is the problem I'm having, there's no errors, just no records matching the > (gt) part. Only exact matches. How about using > (gt) instead of >= (gte)? It doesn't return any records right? Shouldn't it match Carols also since sal_emp is _int? --- Joe Conway &l

[GENERAL] searching array

2005-10-16 Thread Matthew Peter
I was trying to search a array with a GTE to value and it doesn't work. Is this supported? Or am I missing something? SELECT * FROM sal_emp WHERE 1 >= ALL (pay_by_quarter); __ Yahoo! Music Unlimited Access over 1 million songs. Try it free.

Re: [GENERAL] PostgreSQL 8.1 vs. MySQL 5.0? > Access-like Query builder > C++ Vector-based GUI binding

2005-10-15 Thread Matthew Peter
This thread should continue under the proper title since it's been hi-jacked . I didn't read your entire post. If you know how to join a pk and fk it's not difficult to build an effective diagram on paper and reuse the same schema for other applications. > > I think there really is a need for a

Re: [GENERAL] PostgreSQL 8.1 vs. MySQL 5.0?

2005-10-15 Thread Matthew Peter
Someone trying to stick microsoft yet another place they don't belong. --- Johan Wehtje <[EMAIL PROTECTED]> wrote: > Very much a description of the Business I am in. > > For all the criticism leveled at it, I still think > that as a rich > Database Client that permits really rapid > developme

Re: [GENERAL] transaction toggling

2005-10-05 Thread Matthew Peter
--- Richard Huxton wrote: > Matthew Peter wrote: > > Is there a way to disable transactions on certian > > queries? I read a while back that this wasn't > > possible, just wondering if it is in 8.1 or > planned in > > the future? > > > > Does it e

[GENERAL] transaction toggling

2005-10-05 Thread Matthew Peter
Is there a way to disable transactions on certian queries? I read a while back that this wasn't possible, just wondering if it is in 8.1 or planned in the future? Does it even make a dent in the performance if a query is wrapped in a transaction instead of out? Such as a view counter, like... up

[GENERAL] query execution

2005-10-05 Thread Matthew Peter
There a way to watch queries execute on the pgsql server as queries come in from the network and are processed? Thanks MP __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com ---(end of broadcast)

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-23 Thread Matthew Peter
--- Guy Fraser <[EMAIL PROTECTED]> wrote: > On Fri, 2005-23-09 at 09:48 -0700, Matthew Peter > wrote: > > > > --- Guy Fraser <[EMAIL PROTECTED]> wrote: > > > ...snip... > > > OK what I jotted down was totally wrong. > > >

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-23 Thread Matthew Peter
--- Guy Fraser <[EMAIL PROTECTED]> wrote: > On Thu, 2005-22-09 at 21:52 -0500, Bruno Wolff III > wrote: > > On Thu, Sep 22, 2005 at 14:16:48 -0600, > > Guy Fraser <[EMAIL PROTECTED]> wrote: > > > On Thu, 2005-22-09 at 12:43 -0400, Greg Stark > wrote: > > > > Guy Fraser <[EMAIL PROTECTED]> writ

[GENERAL] array_dims array_lower/upper distance

2005-09-20 Thread Matthew Peter
Wondering if there's a way for postgres to return how many elements are in a array as a single integer? For instance, returning 10 (items in array) instead of [-5:4] Also, is there a way to return the position of an item in a array? __ Yahoo! Ma

Re: [GENERAL] list manipulation at column level

2005-09-11 Thread Matthew Peter
TECTED]> wrote: > On Sun, Sep 11, 2005 at 04:02:24PM -0700, Chris > Travers wrote: > > Matthew Peter wrote: > > >Is it possible to append and delete (unknown > location) > > >items in a list stored in a column? For instance, > > > > > >a col

[GENERAL] list manipulation at column level

2005-09-11 Thread Matthew Peter
Is it possible to append and delete (unknown location) items in a list stored in a column? For instance, a column with 'some,values,in,a,list,12,34'; Could I [ap|pre]pend and or delete items in this list through pgsql? _

Re: [GENERAL] back references using regex

2005-09-11 Thread Matthew Peter
ossible, I will read about it if there's docs for it so I don't trouble anyone with my questions. It would be sweet to do that at the database level. Thanks again, MP Posgresql convert --- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Sat, Sep 10, 2005 at 10:27:13AM -0700, Matthew

Re: [GENERAL] back references using regex

2005-09-10 Thread Matthew Peter
c operations in bash scripts. I'll read up more on those. Thanks. MP --- Douglas McNaught <[EMAIL PROTECTED]> wrote: > Matthew Peter <[EMAIL PROTECTED]> writes: > > > One other thing, when I wrote back I actually used > > 34.31.29.20 (random), not 12.00.00.34

Re: [GENERAL] back references using regex

2005-09-09 Thread Matthew Peter
y any "letter, number or underscore"? --- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Thu, Sep 08, 2005 at 01:52:35PM -0700, Matthew > Peter wrote: > > It's not a complex regex as I have wrote one that > does > > what I want, yet not at the database level. The

Re: [GENERAL] back references using regex

2005-09-08 Thread Matthew Peter
Thanks for helping me out and putting up with me. :) matt --- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Thu, Sep 08, 2005 at 01:52:35PM -0700, Matthew > Peter wrote: > > It's not a complex regex as I have wrote one that > does > > what I want, yet not at the

Re: [GENERAL] back references using regex

2005-09-08 Thread Matthew Peter
Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Thu, Sep 08, 2005 at 12:45:40PM -0700, Matthew > Peter wrote: > > Ya, but I'd have to recompile to get python in. > > Recompiling to add support for another procedural > language is a > one-time operation and it's

Re: [GENERAL] back references using regex

2005-09-08 Thread Matthew Peter
er Fein <[EMAIL PROTECTED]> wrote: > Matthew Peter wrote: > > That doesn't seem to work with digits > > > > SELECT substring('12.00.00.34' FROM > $$((\d+)\.\2)$$); > > or > > SELECT substring('12.00.00.34' FROM > $$((\w+)\.\2)

Re: [GENERAL] back references using regex

2005-09-08 Thread Matthew Peter
That doesn't seem to work with digits SELECT substring('12.00.00.34' FROM $$((\d+)\.\2)$$); or SELECT substring('12.00.00.34' FROM $$((\w+)\.\2)$$); but works with strings SELECT substring('abc.foo.foo.xyz' FROM $$((\w+)\.\2)$$); What I basically want to do is have a slice function like Pyth

[GENERAL] table size performace

2005-09-07 Thread Matthew Peter
How many rows does it take for select performance on a table to degrade? I hope this question isn't to ambiguous (ie lollipop licks). But seriously, 100,000? 1,000,000? 10,000,000? With just a regular lookup on an unique index. Nothing crazy or aggregate. EX: select * from bigtable where id = 1234

[GENERAL] back references using regex

2005-09-06 Thread Matthew Peter
Hi. I'm trying to do a slice directly from a table so I can get a brief preview of the articles content by counting \s (spaces), not new paragraphs. Anyone know how it could be done using regular expressions natively? I read the doc but it didn't help me much. Many thanks. MP

Re: [GENERAL] same size VARCHAR or INT IX faster?

2005-09-02 Thread Matthew Peter
I assumed as much. Now's the time for me to optimize so I'd rather know and make optimizations accordingly, than step blindly. Thanks for the reply. As always, your a big help. --- Richard Huxton wrote: > Matthew Peter wrote: > > same size VARCHAR or INT IX faster?

[GENERAL] same size VARCHAR or INT IX faster?

2005-09-01 Thread Matthew Peter
same size VARCHAR or INT IX faster? i assume INT. The reason I ask is I was wondering what (if any) is the avg delay from one over the other? And benefit of one over the other? Thanks. __ Yahoo! Mail Stay connected, organized, and protected. Take

Re: [GENERAL] optimum settings for dedicated box

2005-08-31 Thread Matthew Peter
Hmmm. I was thinking of a more comprehensive solution or document resource. I would like to know what does what. Why tweak that or why not to ya know? Searching gets me such fragmented results I chose to ask the ones whom are more familiar with this fabulous piece of software and used it in real w