[GENERAL] Partitioned table and trigger/insert result horribleness

2009-04-06 Thread Henry
Greetings, I recently successfully partitioned a 100+GB table into many smaller ones for improved select performance, etc. This works extremely well, I must say. SELECTs, UPDATEs and DELETEs are handled automatically by Pg, my trigger takes care of distributing INSERTs, etc. Only proble

Re: [GENERAL] Postgres Security Checklist

2009-04-06 Thread Albe Laurenz
Eduardo Henrique wrote: > Hi, I'm developing a Graduation Work about Database security. > My idea is develop an application that connect in an database > (in this case Postgres) and make some security verification > of that db. The problem is that my verification only can be > in a dabatase sco

Re: [GENERAL] copy from with trigger

2009-04-06 Thread Chris Spotts
Well that's a bummer, ok. Thanks. -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Sunday, April 05, 2009 10:27 PM To: Chris spotts Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] copy from with trigger Chris spotts writes: > I'm trying to copy from a tab de

Re: [GENERAL] user defined aggregate for percentile calculations

2009-04-06 Thread A. Kretschmer
In response to Kashmir : > > cant seem to find anything about this, > would it possible at all to create a percentile-aggregate in pgres? > any pointers? > tia > -k I'm not sure if i understand your problem, but how about: test=*# select * from percentile ; id | value +--- 1 |10

[GENERAL] Number Conversion Function

2009-04-06 Thread Abdul Rehman
Hi all, Can any body help me in converting numeric values into words via postgres function: i.e. 313 to THREE HUNDRED THREE Regards, Abdul Rehman.

Re: [GENERAL] [COMMITTERS]

2009-04-06 Thread Emanuel Calvo Franco
2009/4/6 eehab hamzeh : >     Hello > > I am trying to build some functions using C language. these functions are > mentioned in the postgresql documentation. > > http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html > > Datum > add_one_float8(PG_FUNCTION_ARGS) > { > /* The macros for FLO

Re: [GENERAL] Number Conversion Function

2009-04-06 Thread A. Kretschmer
In response to Abdul Rehman : > Hi all, > > Can any body help me in converting numeric values into words via postgres > function: i.e. 313 to THREE HUNDRED THREE You can use the PERL-Module from http://search.cpan.org/~sburke/Lingua-EN-Numbers-1.01/lib/Lingua/EN/Numbers.pm and plperlU Andreas -

Re: [GENERAL] [COMMITTERS]

2009-04-06 Thread Emanuel Calvo Franco
2009/4/6 eehab hamzeh : > here are the code and the error , i compile them using vc++ 6 and VC++ 2008 > and minGW the example below are for minGW > THANKS > > #include "postgres.h" > #include > #include "fmgr.h" > > #ifdef PG_MODULE_MAGIC > PG_MODULE_MAGIC; > #endif > > /* by value */ > > PG_FUNCT

[GENERAL] compiling c function using MinGW

2009-04-06 Thread eehab hamzeh
this is how i write the command in MinGW any more direction about I. I am a new user for MinGW gcc -shared -o hamzeh.dll tt1.o -L "c:/programme/postgresql/8.3/lib" -lpostgres Thanks Ihab > > 2009/4/6 eehab hamzeh : > > Hello > > > > I am trying to build some functions using C languag

Re: [GENERAL] Number Conversion Function

2009-04-06 Thread Tino Wildenhain
Abdul Rehman wrote: Hi all, Can any body help me in converting numeric values into words via postgres function: i.e. 313 to THREE HUNDRED THREE I would not recommend to do this within the database. Thats typical a job for your presentation layer. Regards Tino -- Sent via pgsql-general maili

[GENERAL] PostgreSQL data modeling tool

2009-04-06 Thread danpop
Hi Guys, ModelRight (http://www.modelright.com), the popular data modeling software maker, has released the 3.5 version of its software, in public beta. This is the version that offers support for (native) PostgreSQL modeling. We think that ModelRight provides the deepest physical support for Po

Re: [GENERAL] Postgres Security Checklist

2009-04-06 Thread Tom Lane
"Albe Laurenz" writes: > Here is my personal security checklist for PostgreSQL: > - Check that there is no SQL function with SECURITY DEFINER. Uh, that seems a pretty strange restriction. Generally, if you are actually concerned about security at the SQL-command level, you're going to have to h

Re: [GENERAL] Number Conversion Function

2009-04-06 Thread Tom Lane
Tino Wildenhain writes: > Abdul Rehman wrote: >> Can any body help me in converting numeric values into words via >> postgres function: i.e. 313 to THREE HUNDRED THREE > I would not recommend to do this within the database. Thats typical > a job for your presentation layer. ... but having said

Re: [GENERAL] Postgres Security Checklist

2009-04-06 Thread Albe Laurenz
Tom Lane wrote: > > Here is my personal security checklist for PostgreSQL: > > > - Check that there is no SQL function with SECURITY DEFINER. > > Uh, that seems a pretty strange restriction. Generally, if you are > actually concerned about security at the SQL-command level, you're > going to hav

Re: [GENERAL] Number Conversion Function

2009-04-06 Thread Albe Laurenz
Abdul Rehman wrote: > Can any body help me in converting numeric values into words > via postgres function: i.e. 313 to THREE HUNDRED THREE Here is a little PL/pgSQL function that should do what you want for numbers < 1. It should be easy to extend if you switch to bigint and decide i

[GENERAL] writing c functions for postgres

2009-04-06 Thread eehab hamzeh
Dear Sir I am trying to build some functions using C language. these functions are mentioned in the postgresql documentation. the only function that are work are the one with int32 variable. the other function bring errors and are not working any body can give directions here are the co

[GENERAL] Convert Oracle function to PostgreSQL

2009-04-06 Thread SHARMILA JOTHIRAJAH
Hi, I use this Oracle function(from AskTom - http://asktom.oracle.com/pls/asktom/f?p=100:11:0P11_QUESTION_ID:210612357425) SQL> create or replace type myTableType as table of varchar2 (255); 2 / Type created. ops$tk...@dev8i> create or replace function in_list( p_str

Re: [GENERAL] How to convert integer to boolean in insert

2009-04-06 Thread Alvaro Herrera
Thomas Kellerer wrote: > If that is a one-time thing, why not create the table with banned as an > integer column and another boolean column (if your INSERTs are properly > listing the column names), then after the import update the boolean to > the casted integer value, drop the integer and re

Re: [GENERAL] copy from with trigger

2009-04-06 Thread Alvaro Herrera
Chris Spotts escribió: > That's a dead link for me. Yes, because the message was very new and the archive indexer hadn't picked it up yet :-) Try again now. > -Original Message- > From: Alvaro Herrera [mailto:alvhe...@commandprompt.com] > Sent: Monday, April 06, 2009 12:42 PM > To: Chr

Re: [GENERAL] Last question

2009-04-06 Thread Emanuel Calvo Franco
2009/4/6 eehab hamzeh : > Dear Sir, > > I have replied to the commiters again while i recive an email from > pgsql-general@postgresql.org > saying this is not the right place for this question, i expect that the > Comitters are the right place. sorry again and i will stop sending emails to > commit

Re: [GENERAL] [COMMITTERS]

2009-04-06 Thread Emanuel Calvo Franco
2009/4/6 eehab hamzeh : > Dear Sir > > I am trying to build some functions using C language. these functions are > mentioned in the postgresql documentation. > > the only function that are work are the one with int32 variable. > the other function bring errors and are not working > any body can giv

Re: [GENERAL] copy from with trigger

2009-04-06 Thread Alvaro Herrera
Chris Spotts escribió: > Well that's a bummer, ok. Thanks. See also http://archives.postgresql.org/message-id/20090406173912.GB4525%40alvh.no-ip.org -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 suppo

[GENERAL] INSERT or UPDATE

2009-04-06 Thread James B. Byrne
I have spent the last couple of days reading up on SQL, of which I know very little, and PL/pgSQl, of which I know less. I am trying to decide how best to approach the following requirement. Given a legal name and a common name and associated details, we wish to insert this information into a tab

Re: [GENERAL] copy from with trigger

2009-04-06 Thread Chris Spotts
That's a dead link for me. -Original Message- From: Alvaro Herrera [mailto:alvhe...@commandprompt.com] Sent: Monday, April 06, 2009 12:42 PM To: Chris Spotts Cc: 'Tom Lane'; pgsql-general@postgresql.org Subject: Re: [GENERAL] copy from with trigger Chris Spotts escribió: > Well that's a

Re: [GENERAL] Number Conversion Function

2009-04-06 Thread Alvaro Herrera
Albe Laurenz wrote: > Abdul Rehman wrote: > > Can any body help me in converting numeric values into words > > via postgres function: i.e. 313 to THREE HUNDRED THREE > > Here is a little PL/pgSQL function that should do what you > want for numbers < 1. > It should be easy to extend if

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-06 Thread Kevin Grittner
Tom Lane wrote: > "Kevin Grittner" writes: >> People are likely to search for statute cites, which tend to have a >> hierarchical form. > I think what you need is a custom parser I've just returned to this and after review have become convinced that this is absolutely necessary; once the def

Re: [GENERAL] How to convert integer to boolean in insert

2009-04-06 Thread Thomas Kellerer
Alvaro Herrera wrote on 06.04.2009 19:39: If that is a one-time thing, why not create the table with banned as an integer column and another boolean column (if your INSERTs are properly listing the column names), then after the import update the boolean to the casted integer value, drop the int

Re: [GENERAL] INSERT or UPDATE

2009-04-06 Thread James B. Byrne
On Mon, April 6, 2009 17:00, Dann Corbit wrote: . > > It is a difficult question. > > For instance, there are many possibilities when a collision occurs. > > I guess that for some collisions, sharing the name is OK. > I failed to explicitly state what the PK looked like. entity_id(entities.id)

[GENERAL] E-mail List -- Feridun Türk

2009-04-06 Thread feridun türk
subscribe end -- Feridun Türk

Re: [GENERAL] INSERT or UPDATE

2009-04-06 Thread Dann Corbit
> -Original Message- > From: James B. Byrne [mailto:byrn...@harte-lyne.ca] > Sent: Monday, April 06, 2009 2:06 PM > To: Dann Corbit > Cc: pgsql-general@postgresql.org > Subject: RE: [GENERAL] INSERT or UPDATE > > On Mon, April 6, 2009 17:00, Dann Corbit wrote: > . > > > > It is a difficult

Re: [GENERAL] INSERT or UPDATE

2009-04-06 Thread Thomas Kellerer
Dann Corbit wrote on 06.04.2009 23:15: I guess that for some collisions, sharing the name is OK. I failed to explicitly state what the PK looked like. entity_id(entities.id) + identifier_type ('AKNA') + identifier_value(entities.common_name) There will only be a PK collision when we att

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-06 Thread Kevin Grittner
Tom Lane wrote: > Perhaps you could pass the texts and the queries through a regexp > substitution that converts digit-dot-digit to digit-dash-digit? This doesn't seem to get me anywhere. For cite '9.125.07(4A)(3)' I got this: select ts_debug('9-125-07-4A-3'); ts_

[GENERAL] coalesce a null to a char ?

2009-04-06 Thread Gauthier, Dave
How can I do this selcet coalesce((select 'y' from foo where name = f.name),'n') from foo f where... So the query returns a "y" or "n" depending on whether or not the subquery is null. I get... "ERROR: failed to find conversion function from unknown to text"

Re: [GENERAL] coalesce a null to a char ?

2009-04-06 Thread Raymond O'Donnell
On 06/04/2009 22:55, Gauthier, Dave wrote: > How can I do this > > selcet coalesce((select 'y' from foo where name = f.name),'n') from foo f > where... > > So the query returns a "y" or "n" depending on whether or not the subquery is > null. Are you sure that the subquery is returning any

Re: [GENERAL] user defined aggregate for percentile calculations

2009-04-06 Thread Kashmir
thx for anwering!, i was more looking for a percentile calculation as in http://en.wikipedia.org/wiki/Percentile usually i do this in perl with the 'Statistics::Descriptive' module, but it would help me alot if i could solve this within the sql query, and would not have to push all the data int

Re: [GENERAL] user defined aggregate for percentile calculations

2009-04-06 Thread Alvaro Herrera
Kashmir wrote: > > thx for anwering!, > > i was more looking for a percentile calculation as in > http://en.wikipedia.org/wiki/Percentile > usually i do this in perl with the 'Statistics::Descriptive' module, > but it would help me alot if i could solve this within the sql query, > and would no

Re: [GENERAL] user defined aggregate for percentile calculations

2009-04-06 Thread Greg Smith
On Sun, 5 Apr 2009, Kashmir wrote: would it possible at all to create a percentile-aggregate in pgres? I normally just do this right in the database without specifically accelerating it with an aggregate. Not very efficient but it works fine for reasonably sized data sets that fit into the

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-06 Thread Kevin Grittner
Tom Lane wrote: > regexp substitution I found a way to at least keep the cite in one piece. Perhaps I can do the rest in custom dictionaries, which are more pluggable. select ts_debug ('State Statute pertaining to'); ts_debug -

[GENERAL] Querying Large Objects

2009-04-06 Thread David Kerr
Hi all, I'm having a heck of a time trying to track this down. Is it possible to retrive a large object from psql/pgbench? I don't want just the OID, i want the actual streamed data. I'm doing a timing comparison between bytea and lo's. So it'd be ideal if I can pull it with pgbench. Thanks Da

Re: [GENERAL] INSERT or UPDATE

2009-04-06 Thread James B. Byrne
On Mon, April 6, 2009 17:15, Dann Corbit wrote: > > The pedagogic solution for this type of problem is called merge. > The last I knew, PostgreSQL did not directly support merge. > So you can accomplish the same thing in two stages: > 1. Check for existence and perform an update if the key is pre

Re: [GENERAL] INSERT or UPDATE

2009-04-06 Thread Dann Corbit
> -Original Message- > From: James B. Byrne [mailto:byrn...@harte-lyne.ca] > Sent: Monday, April 06, 2009 5:16 PM > To: Dann Corbit > Cc: pgsql-general@postgresql.org > Subject: RE: [GENERAL] INSERT or UPDATE > > > On Mon, April 6, 2009 17:15, Dann Corbit wrote: > > > > > The pedagogic s

[GENERAL] media server (mp3 player) on postgresql

2009-04-06 Thread Ivan Sergio Borgonovo
This is a fancy request... but maybe among so many postgresql aficionados there is someone that know if there is any "media server/player" that support postgresql. Once upon a time amarok did support postgres to store and search metadata on songs. It did some pretty tricks with id3 data, postgresq

Re: [GENERAL] INSERT or UPDATE

2009-04-06 Thread James B. Byrne
On Mon, April 6, 2009 20:23, Dann Corbit wrote: > > If a transaction involves rows where some succeed and some fail, > all will roll back. If that is the desired behavior, or if all > operations are singleton, then you won't see any problems. > Do I understand correctly that this means that even

Re: [GENERAL] INSERT or UPDATE

2009-04-06 Thread Dann Corbit
> -Original Message- > From: James B. Byrne [mailto:byrn...@harte-lyne.ca] > Sent: Monday, April 06, 2009 5:43 PM > To: Dann Corbit > Cc: pgsql-general@postgresql.org > Subject: RE: [GENERAL] INSERT or UPDATE > > > On Mon, April 6, 2009 20:23, Dann Corbit wrote: > > > > > If a transactio

[GENERAL] Anyone testing changes to libpq/bcc32.mak?

2009-04-06 Thread ljb
There were some recent changes to libpq/bcc32.mak that broke my attempt to build libpq with the Borland compiler. (OK, not so recent. I've been busy.) Five new modules were added from ports/: dirent dirmod pgsleep open win32error I had to removed two, dirent.c and open.c to get the compilation to w