[GENERAL] array_agg problem

2011-08-19 Thread TJ O'Donnell
(val) from x; select array_agg(val) from x; Well, everything works except the last statement. In 8.4 I get ERROR: could not find array type for data type integer[] I was hoping for [1,2,3,4,5] or at least [1,2,3,3,4,5] or even [[1,2,3],[3,4,5]] Am I not understanding something? Thanks, TJ O'Do

Re: [GENERAL] plpython returns integer[] fails for multi-dimensional array

2010-12-21 Thread TJ O'Donnell
a fn that returns integer[] AND I can't return a two-dimensional array. Not a happy 9.0 camper. Anyone know of any plans to 9.0 plpython to support multi-dimensional arrays? TJ O'Donnell On Tue, Dec 21, 2010 at 4:02 PM, Adrian Klaver wrote: > On Tuesday 21 December 2010 3:25:48

[GENERAL] plpython returns integer[] fails for multi-dimensional array

2010-12-21 Thread TJ O'Donnell
imensional arrays in plpython? TJ O'Donnell -- 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] [pgsql-sql] Daily digest v1.3328 (5 messages)

2010-09-23 Thread TJ O'Donnell
json_encode. I'm all set now. Thanks for the help! TJ O'Donnell On Thu, Sep 23, 2010 at 1:18 AM, Raymond O'Donnell wrote: > On 23/09/2010 02:00, Adrian Klaver wrote: >> >> On Wednesday 22 September 2010 5:40:55 pm David Wilson wrote: >>> >>> On W

Re: [GENERAL] [pgsql-sql] Daily digest v1.3328 (5 messages)

2010-09-22 Thread TJ O'Donnell
Many frameworks do not natively recognize "t" as true and "f" as false. I'm using php, json_encode and extjs. Is it possible to cause the default output of boolean values to be something other than "t" and "f", say "true" and "false" or even 1 and 0? Of course I can do this for an individual query

Re: [GENERAL] Lost password

2008-12-16 Thread TJ O'Donnell
It seems you haven't done anything you need to save, so why not save time and just reinstall postgres? TJ Hi  I started the installation of postrgres got distracted and then started again but forgot my password -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make c

Re: [GENERAL] options for launching sql script asynchronously from web app

2008-11-08 Thread TJ O'Donnell
should use https, and not hard-code passwords...all the usual security precautions. Anything ready? Hard to say without knowing more about your specific needs. TJ O'Donnell http://www.gnova.com I'd like to launch some sql script asynchronously from a web app and have some kind of feed

[GENERAL] cool code_swarm animation of PostgreSQL development since 1996

2008-06-16 Thread TJ O'Donnell
This is a very cool animation for your amusement, amazement and edification. http://www.vimeo.com/1081680 TJ O'Donnell http://www.gnova.com/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/

Re: [GENERAL] PostgreSQL Array Use

2008-03-03 Thread TJ O'Donnell
I use arrays of integers, double or numeric, and text. They are 1 or 2 dimensional. They are usually limited to <100 elements in one dimension and <10 in the other. TJ O'Donnell http://www.gnova.com ---(end of broadcast)--- TIP 1:

Re: [GENERAL] Function to convert from TEXT to BYTEA?

2007-12-12 Thread TJ O'Donnell
I think decode('your string', 'escape') might be what you need. It returns bytea when 'your string' is type text or varchar. TJ http://www.gnova.com Is there a function that will do what I want to convert the datatype without having to create a CAST that PostgreSQL doesn't have natively? How e

[GENERAL] a provocative question?

2007-09-06 Thread TJ O'Donnell
r than databases, in that should disk corruption occur, most of the mail is likely to be unaffected, and any that is damaged can usually be recovered." How naive (optimistic?) is it to think that "the database" can replace "the filesystem"? TJ O'Donnell http://www.g

Re: [GENERAL] Functions on tables

2006-12-16 Thread TJ O'Donnell
I wholeheartedly support the approach BJ is advocating. The notion that methods (functions) and variables (tables) can be defined together is a very useful OO approach. I too find it difficult to recall which functions "belong" to which tables. Of course, some of my functions are very generic and

Re: [GENERAL] R and postgres

2006-11-07 Thread TJ O'Donnell
s back into a R dataframe. There is a nice way to dump a dataframe back into a table which is created for you, with columns and datatypes as appropriate. Hope this helps. TJ O'Donnell http://www.gnova.com/ I'd like to get R to talk to postgresql, but my head's spinning among a web of

Re: [GENERAL] Changing encoding of a database

2006-06-23 Thread TJ O'Donnell
> We've PostgreSQL database, with SQL_ASCII or LATIN1 encoding. We would > like to migrate them to UNICODE. Is there some contributed/available > script, or this is something we should do at hand? I had a similar problem migrating from 7.4 to 8.1 and wanting to go from sql_ascii to utf8. I did the

[GENERAL] aggregate of bitstrings

2006-06-22 Thread TJ O'Donnell
and my orsum without INITCOND returned the proper OR of the remaining values when including all rows in the aggregate. it did not return null. maybe the aggregator (whoever,whatever that is) handles null args differently, not calling the func when the arg is null? pg8.1.3 TJ Florian G. Pf

Re: [GENERAL] recompliing c-language functions with new releases of postgres

2006-05-24 Thread TJ O'Donnell
"TJ O'Donnell" <[EMAIL PROTECTED]> writes: Presumably, the only reason I would HAVE TO recompile is when some header file changes. Is there any guarantee that header files DO NOT change, for example from 7.4.5 to 7.4.8 or even 7.4.12? Can I assume that header fi

[GENERAL] recompliing c-language functions with new releases of postgres

2006-05-24 Thread TJ O'Donnell
I have several c-language extensions to postgres that I distribute. I generally have to recompile my code with a new release of postgres, although sometimes it appears that it functions properly (passes my tests at least) without a recompile. Since my users are all on various releases of postgre

[GENERAL] postgres vs. oracle for very large tables

2006-05-15 Thread TJ O'Donnell
erformance diminishes with large tables (we’ll be going to upwards of hundreds of millions of rows)." Is this pure speculation, opinion, known fact? Does anyone know of measured performance of postgres vs. oracle, specifically with very large tables? TJ O'Donnell www.gnova.com --

[GENERAL] efficiency of group by 1 order by 1

2006-03-17 Thread TJ O'Donnell
my func is rather expensive. Is func(x) evaluated three times in the above statement? Would it be evaluated only once if I used select func(x)group by 1 order by 1 TJ O'Donnell www.gnova.com ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] Five reasons why you should never use PostgreSQL -- ever

2006-03-15 Thread TJ O'Donnell
Slashdot had this today. http://searchopensource.techtarget.com/originalContent/0,289142,sid39_gci1172668,00.html TJ O'Donnell www.gnova.com ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desi

Re: [GENERAL] I see this as the end of BDB in MySQL without a doubt.

2006-02-15 Thread TJ O'Donnell
any purchases were intended simply to confuse people about the future of MySQL and therefore ecourage them to select Oracle? TJ O'Donnell http://www.gnova.com/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Converting Text to Bytea

2006-02-01 Thread TJ O'Donnell
decode(your_string,'escape') will convert text to bytea You can just use this as a sort of type cast, or: 1. Create a new bytea column in your table 2. Update the table, setting the newcolumn = decode(oldcolumn,'escape') 3. Drop the oldcolumn (or not) TJ Date: Wed, 01 Feb 2006 10:04:36 + Fr

[GENERAL] Oracle DB Worm Code Published

2006-01-07 Thread TJ O'Donnell
ny default user/password? Is this an issue we should be concerned about, at some level? TJ O'Donnell ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] using new bitmap scans to index bit columns?

2005-11-09 Thread TJ O'Donnell
data. bitmask is precomputed/stored as bit(1024) = fingerprint(datacolumn) contains(a,b) returns bool as 'select b=(a&b);' This works well because matches() is an expensive functions. But it would work better if bitmask could be indexed, no? TJ O'Donnell

Re: [GENERAL] resetting superuser password

2005-11-09 Thread TJ O'Donnell
I would unix su, edit pg_hba.conf to allow open access temporarily, connect to pg and change the posgres password. Don't forget to change pg_hba.conf back again to password protect the db! TJ I have lost the superuser (user postgres) password, but I still have the unix root password. Is there

Re: [GENERAL] new type question

2005-10-17 Thread TJ O'Donnell
I was needing something similar last week, not to throw an error, but to catch an error when 99% of my column's data is real, but some is not (e.g. '1.2-1.4' or '>32.7'). I wanted to do it in pure SQL, but settled on this. Is there a way to do this in pure SQL (so it will be faster)? Declare x

[GENERAL] dynamic loading of .so

2005-10-14 Thread TJ O'Donnell
I have begun to use some static variables in my c-language functions to maintain state (3rd party licensing issues) during the course of a session (postgres process, spawned by postmaster). When I use dynamic loading of my .so, each session is independent, with its own static variables. Will the s

[GENERAL] dynamic loading of .so

2005-10-14 Thread TJ O'Donnell
I have begun to use some static variables in my c-language functions to maintain state (3rd party licensing issues) during the course of a session (postgres process, spawned by postmaster). These are declared static outside the scope of any function. (is global the correct term anymore?) When I us

Re: [GENERAL] problem with bit(n) type

2005-10-12 Thread TJ O'Donnell
i in the text range, one could say there is a text equivalent, but in general not. I think you're looking for some kind of printf-type %b function? Maybe someone has written one, or maybe you'll have to do so. If you do, how about a hex representation of bit(n) - I could use th

[GENERAL] c-language function .h file changes between (major) versions

2005-09-26 Thread TJ O'Donnell
I've been developing c-language functions in 7.4.5 and 7.4.8. I had not encountered a need to recompile, because of pg .h file, or other differences. I expected a need to do so when upgrading to 8.0.3. But I forgot to do so and it worked!! I figured I lucked out, a suspicion which was confirmed

Re: [GENERAL] do separate databases have any impact each other?

2005-08-16 Thread TJ O'Donnell
Alvaro Herrera wrote: On Mon, Aug 15, 2005 at 01:15:03PM -0700, TJ O'Donnell wrote: While writing installation instructions for my new PostgreSQL product, I found myself writing the following sentence: "For first time users, we recommend building the gnova database, since it has

[GENERAL] do separate databases have any impact each other?

2005-08-15 Thread TJ O'Donnell
While writing installation instructions for my new PostgreSQL product, I found myself writing the following sentence: "For first time users, we recommend building the gnova database, since it has no impact on other databases." Is this really true? Of course, my gnova database will take some dis

[GENERAL] append to the current search_path

2005-08-12 Thread TJ O'Donnell
How can I append to the current search_path? How can I put $user (back) into the search path? These commands all fail: set search_path $user,public,gnova; set search_path \$user,public,gnova; set search_path '$user',public,gnova; Ideally, I would like something like PATH=${PATH}:/usr/local/bi

Re: [GENERAL] best way to reference tables

2005-08-10 Thread TJ O'Donnell
Alvaro Herrera <[EMAIL PROTECTED]> writes: On Tue, Aug 09, 2005 at 04:01:33PM -0400, Tom Lane wrote: Yeah, you can store the pg_class OID of the table, Maybe it is possible to use a column of type regclass to store it. Not sure exactly what advantage that would give, but it's an idea.

Re: [GENERAL] best way to reference tables

2005-08-09 Thread TJ O'Donnell
> TJ O'Donnell wrote: >> I have many different tables that I want to keep track of. >> So, I thought of a master table with those table names in it. >> But, to maintain this (suppose a table changes >> its name, gets dropped) I want to have some kind of referentia

[GENERAL] best way to reference tables

2005-08-09 Thread TJ O'Donnell
I have many different tables that I want to keep track of. So, I thought of a master table with those table names in it. But, to maintain this (suppose a table changes its name, gets dropped) I want to have some kind of referential integrity - the way foreign keys and constraints do. What could I

[GENERAL] user's groups

2005-08-02 Thread TJ O'Donnell
I know of the four user's group listed at http://pugs.postgresql.org/ I'm interested in starting one in the San Diego area. If there are others in San Diego who are interested, please get in touch with me. Thanks, TJ O'Donnell [EMAIL PROTECTED] ---(e

[GENERAL] dynamic loading of c-functions

2005-07-21 Thread TJ O'Donnell
It is clear from the manual that c-functions can cause the dynamic loading of .so's and that subsequent usage in the same database session will use the already loaded function. But, when the session is done, will the loaded function remain in the server for subsequent sessions? When/how does a dyn

Re: [GENERAL] [SQL] dynamically loaded functions

2005-07-13 Thread TJ O'Donnell
ichael Fuhr wrote: On Mon, Jul 11, 2005 at 08:16:17PM -0700, TJ O'Donnell wrote: CREATE or REPLACE FUNCTION cansmiles(varchar) RETURNS varchar AS 'gnova', 'oe_cansmiles' LANGUAGE 'c' IMMUTABLE STRICT; requires preloading of oe_chem.so to work. Is there any

[GENERAL] user privilege to create c function

2005-07-12 Thread TJ O'Donnell
Until now I have been content to have the superuser CREATE FUNCTION...LANGUAGE 'C' because I noticed that ordinary users could not: ERROR: permission denied for language c I would like to allow a user to create C language functions, but can't find just which privilege I need to grant. The user

[GENERAL] varbit functions

2005-04-02 Thread TJ O'Donnell
I'm using bit and bit varying datatypes to store chemical "fingerprints" and need various functions to operate on these datatypes. The logical operators (and, or, not) and the shift operators, as well as length and octet-length all work fine on bit types. I was hoping for a manual entry that spec

[GENERAL] bit varying(512) vs bytea(64)

2005-03-21 Thread TJ O'Donnell
I have N-bit data pairs. I want to write a c-language function which compares bits set in each. N is typically 512, but could be other. I can store this as bit varying(512) or bytea(64). I can't decide which. Here are the questions that concern me. 1) will each take the same storage? 2) can I pa

[GENERAL] does the planner "learn"?

2005-02-07 Thread TJ O'Donnell
I understand the value of indexes and of ANALYZE for the efficient use of them. In the following statement, you can see that the index scan is being used. Even though it takes 80 seconds (for a 1.25 million row table), it is much faster than without the index. But, if I repeat this search, it speed

Re: [GENERAL] Does indexing help >= as well as = for integer columns?

2005-02-02 Thread TJ O'Donnell
the histograms that Analyze creates?" Are they available anywhere? The docs mention them (bins) and I was hoping Analyze Verbose would show them to me. TJ Tom Lane wrote: "TJ O'Donnell" <[EMAIL PROTECTED]> writes: This I don't get. Why is an index scan not used? Isn&#

[GENERAL] Does indexing help >= as well as = for integer columns?

2005-02-01 Thread TJ O'Donnell
I have a table of about 5 million rows, 24 columns. Integer column _c is BTREE indexed (as is _n, _o and 3 others). This I understand and like: Explain Analyze Select count(smiles) from structure where _c = 30 Aggregate (cost=105595.11..105595.11 rows=1 width=32) (actual time=17.722..17.724 rows

Re: [GENERAL] visualizing B-tree index coverage

2005-01-27 Thread TJ O'Donnell
I realize that using OR will not result in an index scan. I will never be interested in a OR condition for the kinds of searches I use. In my Select statements, I always name every column of the multi-column index in same order that they were named when creating the index. I always use the >= con

Re: [GENERAL] visualizing B-tree index coverage

2005-01-25 Thread TJ O'Donnell
n't a straight binary tree, I don't think that having highly > dissimilar data in the > index should be a problem. > > Do you have data or experience that shows otherwise? > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Beh

[GENERAL] visualizing B-tree index coverage

2005-01-25 Thread TJ O'Donnell
Does anyone know of a tools that allows one to visualize the tree created by a multi-column B-tree index? A picture of a tree with branches, showing how "branchy" the tree is would be great. I'm wondering how well I've "clustered" the data in my table using the multi-column index. In other words,

Re: [GENERAL] how to optimize my c-extension functions

2005-01-10 Thread TJ O'Donnell
seen so far. TJ Tom Lane wrote: "TJ O'Donnell" <[EMAIL PROTECTED]> writes: The only type of search will be of the type: Select smiles,id from structure where oe_matches(smiles,'c1c1C(=O)N'); You haven't really said much about how you expect an index to be

Re: [GENERAL] how to optimize my c-extension functions

2005-01-09 Thread TJ O'Donnell
s which would speed up the search), is there a way I can create and maintain a table related to the table containing the smiles - and all behind the scenes so the sql user is unaware of this. My thought was that an index is like that and I might borrow some of the internal uses of indexing for m

Re: [GENERAL] how to optimize my c-extension functions

2005-01-09 Thread TJ O'Donnell
To add to my last followup posting, the only way I use oe_mathces(smiles) is in something like the following: Select smiles,id from structure where oe_matches(smiles,'CCOC'); The match string 'CCOC' in this case, varies widely according to the needs of the user during that session. It is analogous

Re: [GENERAL] how to optimize my c-extension functions

2005-01-09 Thread TJ O'Donnell
table related to the table containing the smiles - and all behind the scenes so the sql user is unaware of this. My thought was that an index is like that and I might borrow some of the internal uses of indexing for my purposes. TJ O'Donnell [EMAIL PROTECTED] Pierre-Frédéric Caillaud wrote:

[GENERAL] how to optimize my c-extension functions

2005-01-08 Thread TJ O'Donnell
ese details from the user - meaning they would not have to create/update these additional columns? Thanks, TJ O'Donnell ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match