Re: [GENERAL] encoding confusion

2008-06-10 Thread Sim Zacks
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The data in the longblob field might be text, which could be causing the confusion. For example, when I look at the data in the longblob field, I see /n for a newline and when I look at the bytea it is 012. I can only tell you what happened in the cli

Re: [GENERAL] encoding confusion

2008-06-10 Thread Albe Laurenz
Sim Zacks wrote: > We originally tested it on mysql and now we are migrating it > to postgresql. > > The messages are stored in a longblob field on mysql and a bytea field > in postgresql. > > I set the database up as UTF-8, even though we get emails that are not > UTF encoded, mostly because I

[GENERAL] what gives: SELECT INVALID SELECT STATEMENT TO FORCE ODBC DRIVER TO UNPREPARED STATE

2008-06-10 Thread Richard Broersma
Server logs below. Notice how an error raised in a connection to the proj02u20411 database forces the transaction in the instrumentation database to rollback. Can anyone explain why connections that as far as PG should conserned are unrelated are actually interferring with one another? ---

Re: [GENERAL] Large objects oids

2008-06-10 Thread Tom Lane
David Wall <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Yup, and in practice you'd better have a lot less than that or assigning >> a new OID might take a long time. > What's a rough estimate of "a lot less"? Are we talking 2 billion, 3 > billion, 1 billion? It's difficult to say --- the as

Re: [GENERAL] Large objects oids

2008-06-10 Thread David Wall
Tom Lane wrote: David Wall <[EMAIL PROTECTED]> writes: Since large objects use OIDs, does PG 8.3 have a limit of 4 billion large objects across all of my various tables Yup, and in practice you'd better have a lot less than that or assigning a new OID might take a long time. What

Re: [GENERAL] pg_query & $result re-fill

2008-06-10 Thread Scott Marlowe
On Tue, Jun 10, 2008 at 9:33 AM, Stefan Schwarzer <[EMAIL PROTECTED]> wrote: > Here I would like to check: > >IF param1 < 75 THEN region-in-$result-should-be-set-to-NULL Not sure I get what all you're wanting to do from your message, but could you use a case statement in sql to do this?

Re: [GENERAL] Large objects oids

2008-06-10 Thread Tom Lane
David Wall <[EMAIL PROTECTED]> writes: > Since large objects use OIDs, does PG 8.3 have a limit of 4 billion > large objects across all of my various tables Yup, and in practice you'd better have a lot less than that or assigning a new OID might take a long time. > (actually, I presume OIDs > a

Re: [GENERAL] [ANNOUNCE] PostgreSQL Software Catalogue

2008-06-10 Thread Dave Page
On Tue, Jun 10, 2008 at 5:56 PM, Tatsuo Ishii <[EMAIL PROTECTED]> wrote: > Is it possible for non-software services to be listed in the list? > What I have in my mind is, PostgreSQL Certification program. Hi, The software catalogue is just for software - a certification service would fit more app

[GENERAL] Large objects oids

2008-06-10 Thread David Wall
Since large objects use OIDs, does PG 8.3 have a limit of 4 billion large objects across all of my various tables (actually, I presume OIDs are used elsewhere besides just large objects)? Is there any plan on allowing large objects to support more than 2GB? As data gets larger and larger, I c

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Leif B. Kristensen
On Tuesday 10. June 2008, Michael Fuhr wrote: >Something between my message and your shell appears to have converted >a few spaces to no-break spaces. A hex dump of your query shows the >following: > > 73 65 6c 65 63 74 20 72 65 67 65 78 70 5f 72 65 |select > regexp_re| 0010 70 6c

Re: [GENERAL] [ANNOUNCE] PostgreSQL Software Catalogue

2008-06-10 Thread Tatsuo Ishii
Is it possible for non-software services to be listed in the list? What I have in my mind is, PostgreSQL Certification program. -- Tatsuo Ishii SRA OSS, Inc. Japan > I'm pleased to announce the launch of the PostgreSQL Software Catalogue at: > > http://www.postgresql.org/download/product-cate

[GENERAL] pg_query & $result re-fill

2008-06-10 Thread Stefan Schwarzer
Hi there, I used to pass a the $result of a pg_query to a function which detects min, max etc. Now, I inserted before that another query which first queries a set of parameters for the selected regions. Only if these parameters are fulfilled for each of the regions, the values of the abov

Re: [GENERAL] encoding confusion

2008-06-10 Thread Richard Huxton
Sim Zacks wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 {BACKGROUND] I am testing dbmail for our corporate email solution. We originally tested it on mysql and now we are migrating it to postgresql. The messages are stored in a longblob field on mysql and a bytea field in postgresql. I

Re: [GENERAL] Multithreaded queue in PgSQL

2008-06-10 Thread Scott Marlowe
On Tue, Jun 10, 2008 at 4:40 AM, Nikola Milutinovic <[EMAIL PROTECTED]> wrote: > Hi all. > > This may be trivial, but I cannot find good references for it. The problem > is this: > > Suppose we have one table in PgSQL which is a job queue, each row represents > one job with several status flags, ID

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Tom Lane
CaT <[EMAIL PROTECTED]> writes: > There's a bug in your version of pcre I think as postgres would have > little to do with the regex itself (I be guessing). You be wrong ... PG uses Tcl's regex engine, not pcre, and this behavior is as documented. No, I don't know why Henry Spencer chose to do it

[GENERAL] Strange ODBC error & statement in Server log

2008-06-10 Thread Richard Broersma
I am trying to use a clientside prepared query using vb and ado. Can anyone explain what I might be doing wrong that is causing ODBC to complain? Here are the strange logs that I am seeing: 2008-06-09 10:22:00 ERROR: syntax error at or near "SELECT" at character 16 2008-06-09 10:22:00 STATEMENT

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread CaT
On Tue, Jun 10, 2008 at 03:43:02PM +0200, Leif B. Kristensen wrote: > On Tuesday 10. June 2008, Leif B. Kristensen wrote: > >Hey, I told it not to be greedy, didn't I? > > Found it. I must make *both* atoms non-greedy: That makes no sense. Take this bit of perl, which works as expected: $str = '

Re: [GENERAL] Multithreaded queue in PgSQL

2008-06-10 Thread laser
Nikola Milutinovic wrote: Hi all. This may be trivial, but I cannot find good references for it. The problem is this: Suppose we have one table in PgSQL which is a job queue, each row represents one job with several status flags, IDs,... Several processes will attempt to access the queue an

Re: [GENERAL] Re: Accessing other databases with DBLink when leaving user/password empty

2008-06-10 Thread Adrian Klaver
On Tuesday 10 June 2008 12:41 am, Hermann Muster wrote: > > Adrian Klaver wrote: > > On Friday 06 June 2008 2:32 am, Hermann Muster wrote: > >> Does no one have any idea about that? > >> > >> Regards. > >> > >> Hermann Muster wrote: > >>> Hi, > >>> > >>> I have the following problem when trying to

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Leif B. Kristensen
On Tuesday 10. June 2008, CaT wrote: >On Tue, Jun 10, 2008 at 03:43:02PM +0200, Leif B. Kristensen wrote: >> On Tuesday 10. June 2008, Leif B. Kristensen wrote: >> >Hey, I told it not to be greedy, didn't I? >> >> Found it. I must make *both* atoms non-greedy: > >That makes no sense. Take this bit

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Michael Fuhr
On Tue, Jun 10, 2008 at 07:41:53AM -0600, Michael Fuhr wrote: > On Tue, Jun 10, 2008 at 02:59:53PM +0200, Leif B. Kristensen wrote: > > So far, so good. But look here: > > > > pgslekt=> select link_expand('[p=123|John Smith] and [p=456|Jane Doe]'); > > link_expand > >

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Leif B. Kristensen
On Tuesday 10. June 2008, Leif B. Kristensen wrote: >Hey, I told it not to be greedy, didn't I? Found it. I must make *both* atoms non-greedy: pgslekt=> CREATE OR REPLACE FUNCTION link_expand(TEXT) RETURNS TEXT AS $$ SELECT REGEXP_REPLACE($1, E'\\[p=(\\d+?)\\|(.+?)\\]', E

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Michael Fuhr
On Tue, Jun 10, 2008 at 02:59:53PM +0200, Leif B. Kristensen wrote: > So far, so good. But look here: > > pgslekt=> select link_expand('[p=123|John Smith] and [p=456|Jane Doe]'); > link_expand > --- >

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Michael Fuhr
On Tue, Jun 10, 2008 at 02:25:44PM +0200, Leif B. Kristensen wrote: > Thank you Michael, I figured it was something fishy with the escaping. > When I try your example, I get > > pgslekt=> select regexp_replace( > pgslekt(>    '[p=1242|John Smith]', > pgslekt(>   e'\\[p=(\\d+)\\|(.+?)\\]', > pgsle

[GENERAL] encoding confusion

2008-06-10 Thread Sim Zacks
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 {BACKGROUND] I am testing dbmail for our corporate email solution. We originally tested it on mysql and now we are migrating it to postgresql. The messages are stored in a longblob field on mysql and a bytea field in postgresql. I set the database u

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Leif B. Kristensen
I put the code into a function, link_expand(): CREATE OR REPLACE FUNCTION link_expand(TEXT) RETURNS TEXT AS $$ SELECT REGEXP_REPLACE($1, E'\\[p=(\\d+)\\|(.+?)\\]', E'\\2', 'g'); $$ LANGUAGE sql STABLE; pgslekt=> select link_expand('[p=123|John Smith]');

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Leif B. Kristensen
On Tuesday 10. June 2008, Michael Fuhr wrote: >Parts of the regular expression need more escaping.  Try this: > >select regexp_replace( >   '[p=1242|John Smith]', >  e'\\[p=(\\d+)\\|(.+?)\\]', >  e'\\2' >); > >                  regexp_replace >--- > J

Re: [GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Michael Fuhr
On Tue, Jun 10, 2008 at 01:28:06PM +0200, Leif B. Kristensen wrote: > I want to transform the text '[p=1242|John Smith]' to > John Smith, but what I get is: > > pgslekt=> select REGEXP_REPLACE('[p=1242|John Smith]', > pgslekt(> E'[p=(\d+)|(.+?)]', > pgslekt(> E'\\2'); > regexp

Re: [GENERAL] Multithreaded queue in PgSQL

2008-06-10 Thread Nikola Milutinovic
> You may find that the PGQ component of skytools is what you want: > http://pgfoundry.org/projects/skytools > http://skytools.projects.postgresql.org/doc/ > http://skytools.projects.postgresql.org/doc/pgq-sql.html > Thanks, we will look into it. Still, I am surprised to learn that SQL as such

[GENERAL] REGEXP_REPLACE woes

2008-06-10 Thread Leif B. Kristensen
I want to transform the text '[p=1242|John Smith]' to John Smith, but what I get is: pgslekt=> select REGEXP_REPLACE('[p=1242|John Smith]', pgslekt(> E'[p=(\d+)|(.+?)]', pgslekt(> E'\\2'); regexp_replace -- [=1242|John Smith

[GENERAL] Query on Oracle 10g Merge Function equivalent command/function in Postgre

2008-06-10 Thread IPS
Query on database migration  We are thinking of migrating one application from Oracle 10g to Postgre environment. We are using Oracle 10g Merge functionality to comprae and filter out the  records into two groups. The master database size is having about 11 million r

Re: [GENERAL] Multithreaded queue in PgSQL

2008-06-10 Thread Dimitri Fontaine
Le mardi 10 juin 2008, Nikola Milutinovic a écrit : > Suppose we have one table in PgSQL which is a job queue, each row > represents one job with several status flags, IDs,... Several processes > will attempt to access the queue and "take" their batch of jobs, the batch > will have some parameteriz

Re: [GENERAL] Insert into master table ->" 0 rows affected" -> Hibernate problems

2008-06-10 Thread Mattias.Arbin
I tried using rules instead. I did something very similar to this: CREATE RULE measurement_insert_y2006m02 AS ON INSERT TO measurement WHERE ( logdate >= DATE '2006-02-01' AND logdate < DATE '2006-03-01' ) DO INSTEAD INSERT INTO measurement_y2006m02 VALUES (NEW.*); ... CREATE RULE measureme

[GENERAL] Multithreaded queue in PgSQL

2008-06-10 Thread Nikola Milutinovic
Hi all. This may be trivial, but I cannot find good references for it. The problem is this: Suppose we have one table in PgSQL which is a job queue, each row represents one job with several status flags, IDs,... Several processes will attempt to access the queue and "take" their batch of jobs,

[GENERAL] Re: Accessing other databases with DBLink when leaving user/password empty

2008-06-10 Thread Hermann Muster
Tommy Gildseth wrote: Hermann Muster wrote: Hi Adrian, I tried what you suggested, but still get the following Error: "Error connecting to the server: fe_sendauth: no password supplied" What is it I'm doing wrong? Isn't it possible to leave the password empty so that PostgreSQL can retrieve i

Re: [GENERAL] Insert into master table ->" 0 rows affected" -> Hibernate problems

2008-06-10 Thread Magnus Hagander
I think that if you use a RULE instead of a TRIGGER to redirect the write, it should return the proper number of rows inserted in the child table. //Magnus [EMAIL PROTECTED] wrote: > Scott, > You're right, of course. I meant, is there a way to make Postgres return > the number of rows inserted t

Re: [GENERAL] Re: Accessing other databases with DBLink when leaving user/password empty

2008-06-10 Thread Tommy Gildseth
Hermann Muster wrote: Hi Adrian, I tried what you suggested, but still get the following Error: "Error connecting to the server: fe_sendauth: no password supplied" What is it I'm doing wrong? Isn't it possible to leave the password empty so that PostgreSQL can retrieve it from the current acco

[GENERAL] Re: Accessing other databases with DBLink when leaving user/password empty

2008-06-10 Thread Hermann Muster
Hi Adrian, I tried what you suggested, but still get the following Error: "Error connecting to the server: fe_sendauth: no password supplied" What is it I'm doing wrong? Isn't it possible to leave the password empty so that PostgreSQL can retrieve it from the current account? Thank you. Ad

Re: [GENERAL] Insert into master table ->" 0 rows affected" -> Hibernate problems

2008-06-10 Thread Mattias.Arbin
Scott, You're right, of course. I meant, is there a way to make Postgres return the number of rows inserted to any child table _via_ the master table + trigger function? I have not been able to find a way to tell Hibernate to ignore the returned number of rows, unless I insert via a custom insert

Re: [GENERAL] nested view with outer joins - best practices

2008-06-10 Thread Bohdan Linda
On Mon, Jun 09, 2008 at 04:41:16PM +0200, Tom Lane wrote: > 8.0 is incapable of reordering outer joins, which is likely the cause of > your problem. Thank you, will try. Bohdan -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://ww