[GENERAL] Functions, composite types and Notice

2007-01-31 Thread Hakan Kocaman
Hi group, got a question regarding the different kinds calling a function returning record. This is 8.1.3 on gnu/linux. Consider this function: CREATE OR REPLACE FUNCTION public.check_notice( IN in_a int, IN in_b text, OUT out_a int, OUT out_b text ) RETURNS record as $BODY$ DECLARE BEGIN -- I

Re: [GENERAL] PG Email Client

2007-01-31 Thread Michael Slattery
Please keep us posted on your archiveopteryx experience! Thanks and Cheers. They may have fixed this in the meantime. I did look at the schema for archiveopteryx, and it looked to me to be much better thought out. I got as far as compiling archiveopteryx on my OS of choice (OpenBSD, no f

Re: [GENERAL] PG Email Client

2007-01-31 Thread Jim Rosenberg
dbmail isn't as fast as dovecot for a single user, single event. But not by much. However, it scales *much* better into the 100's and 1000's of actions. <$.02> I came within an eyelash of going live with dbmail, and then pulled back. This was a year or so ago, I don't remember exactly. The p

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Mark Walker
Oops, making a fool of myself again. I don't think this is possible. Code signing authentication works by comparing an application to a digital signature that can't be generated without a password. Since the server doesn't have a copy of the application or signature, it won't work. Oh well,

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/31/07 20:00, Paul Lambert wrote: > Mark Walker wrote: >> One other thing. Another approach to this problem would be to have >> some sort of code signing/authentication capabilities for the >> postgresql server. For instance, you login as an adm

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Mark Walker
But you don't have to turn it on by default for any particular database, and you could sign any application you want for your individual server. Paul Lambert wrote: Mark Walker wrote: One other thing. Another approach to this problem would be to have some sort of code signing/authentication

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Paul Lambert
Mark Walker wrote: One other thing. Another approach to this problem would be to have some sort of code signing/authentication capabilities for the postgresql server. For instance, you login as an administrator (some sort of enhanced privs), you get to look at the databases you have permissio

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Mark Walker
One other thing. Another approach to this problem would be to have some sort of code signing/authentication capabilities for the postgresql server. For instance, you login as an administrator (some sort of enhanced privs), you get to look at the databases you have permission for. Otherwise,

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Mark Walker
If hiding the password in your application is an option, i.e. you only have one database your application will ever connect to, then at least scramble the password within your application with some complex algorithm. If you can't hide the password in your application, then you need to deny acc

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Paul Lambert
Andrus wrote: Run the application on a machine you control. Then the application can authenticate without the users being able to steal or piggyback on its credentials. Thank you for reply. My application is GUI applicatio which must run in customer computer and accesses to 5432 port in remote

Re: [GENERAL] 8.2 planner and "like"

2007-01-31 Thread Angva
Thanks so much for that info, Tom! On Jan 29, 8:00 pm, [EMAIL PROTECTED] (Tom Lane) wrote: > "Angva" <[EMAIL PROTECTED]> writes: > > Our company's application runs searches with "like" where clauses, for > > example: "where id like '38F20A%'". This query once ran in under 10 ms, > > but since upgr

Re: [GENERAL] Problem loading pg_dump file

2007-01-31 Thread Tom Lane
"Mason Hale" <[EMAIL PROTECTED]> writes: > Then I noticed was that our original dump file from 1 week ago was 7GB, and > the one today was 14GB. > We've had a lot of db activity, but I doubt our database has doubled in size > in just one week. > Now I'm thinking that the 7GB dump file was somehow

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Andrus
> If only certain privileged users are supposed to use pgAdmin, can you > arrange so that only they have access to it in the first place? - such as > granting execute permissions on pgAdmin only to the privileged users? PgAdmin can be ran from customer computer. It is not possible to disable cus

[GENERAL] Ordering problem with varchar (DESC)

2007-01-31 Thread Alexandre Leclerc
Hi all, We have a column (varchar) that has plain text time and it is indexed. When I do a query with the index, all the data is in the right order, but when I user ORDER BY .. DESC, the order is messed up. Example: By index 1: (date, time, data) SELECT * from t1; date (date type) time (varchar)

Re: [GENERAL] How to allow users to log on only from my application not from pgadmin

2007-01-31 Thread Andrus
> Run the application on a machine you control. Then the application can > authenticate without the users being able to steal or piggyback on its > credentials. Thank you for reply. My application is GUI applicatio which must run in customer computer and accesses to 5432 port in remote PostgreSQL

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Angva
As others have said, sequences can have gaps. In fact, the thought of a gap-free sequence is scary to me. Unless you do very few inserts, "gap-free sequence" is pretty much synonymous with "not scalable". If your goal is to generate a unique number for each row (which is usually the case), then gap

Re: [GENERAL] Problem loading pg_dump file

2007-01-31 Thread Tom Lane
"Mason Hale" <[EMAIL PROTECTED]> writes: > Here's the first error I run across: > > ***(Single step mode: verify > command)*** > COPY blocked_info (id, created_at, reason_code, note, do_count_links) FROM > stdin; > ***(press return to proceed or enter x and r

Re: [GENERAL] Problem loading pg_dump file

2007-01-31 Thread Mason Hale
I was able to successfully able to dump and restore my database this morning. Here's what I did: After doing single table restore to a text file of the rawfeed table (the one the triggered the error), I was able to get the id of the last row that was successfully exported. As mentioned earlier I

Re: [GENERAL] SQL to get a table columns comments?

2007-01-31 Thread Timasmith
On Jan 30, 12:15 pm, "codeWarrior" <[EMAIL PROTECTED]> wrote: > SELECT > CASE > WHEN sfl.description IS NOT NULL THEN sfl.description > WHEN sfl.description IS NULL THEN pa.attname::character varying > ELSE pd.description::character varying > END

Re: [GENERAL] replication choices

2007-01-31 Thread Ben
Well, it sounds like your situation is more difficult than mine, in that it looks like you might have to deal with the possibility of conflicting changes. Fortuantely, I don't have that issue, because even though I have data flowing both ways between my "master" and my sites, it only flows one

Re: [GENERAL] replication choices

2007-01-31 Thread Guido Neitzer
On 31.01.2007, at 14:53, Lenorovitz, Joel wrote: I do not know of any product, Slony included, that has built in support for a situation such as this, so I suspect all of the details will have to be handled in a custom fashion. It is not relevant for you as your are using PostgreSQL (for g

Re: [GENERAL] replication choices

2007-01-31 Thread Lenorovitz, Joel
I believe I have a similar situation involving multiple database instances acting quasi-independently on a common (at least conceptually) set of data. Since each instance can effectively operate independently, I am uncertain if the term replication is accurate, but here is my strategy to keep the

Re: [GENERAL] pg migrator

2007-01-31 Thread Erik Jones
[EMAIL PROTECTED] wrote: > I downloaded the tarball. It's interesting that the search engine on > the > pgfoundary part of the site could not find it. I used Google, and it > was the > top hit. Once I knew where to look I could find it on the site, but only > manually moving through the pages

Re: [GENERAL] pg migrator

2007-01-31 Thread korryd
> > I downloaded the tarball. It's interesting that the search engine on > > the > > pgfoundary part of the site could not find it. I used Google, and it > > was the > > top hit. Once I knew where to look I could find it on the site, but only > > manually moving through the pages. > I had the s

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread Mark Walker
I used to have OOM killer problems with Tomcat, Apache's JSP server, but not any more. A new variable appeared in the config settings which had to do with the maximum memory that Tomcat would use for itself, and I think that may have been what fixed the problem. Does Postgresql need something

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread Richard Troy
On Wed, 31 Jan 2007, Jeff Davis wrote: > > I know this is off-topic for this list, but is there a place I can get > some details about linux OOM killer, and the conditions that cause this > OS hang when you turn off the OOM killer? I'd like to really know what's > happening, and also know more abo

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/31/07 12:37, Jeff Davis wrote: > On Tue, 2007-01-30 at 20:44 -0800, David Fetter wrote: >> On Tue, Jan 30, 2007 at 04:43:14PM -0800, Richard Troy wrote: >>> On Tue, 30 Jan 2007, Mark Walker wrote: I don't know. My customers expect 24/7 reli

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread Richard Troy
On Wed, 31 Jan 2007, Tom Lane wrote: > David Fetter <[EMAIL PROTECTED]> writes: > > On Tue, Jan 30, 2007 at 04:43:14PM -0800, Richard Troy wrote: > >> ... different in my opinion if only Unix didn't have this asenine view > >> that the choice between a memory management strategy that kills > >> ra

Re: [GENERAL] Ordering problem with varchar (DESC)

2007-01-31 Thread Alexandre Leclerc
Daniel Verite a écrit : > Alexandre Leclerc wrote: > >> SELECT * from t1 ORDER BY date, time DESC; >> date (date type) time (varchar) data >> 2007-01-30 9h30 d2 >> 2007-01-3017h20 d5 >> 2007-01-3013h45 d4 >> 2007-01-3012h00

Re: [GENERAL] Ordering problem with varchar (DESC)

2007-01-31 Thread Alexandre Leclerc
Brandon Aiken a écrit : > As others have said, VARCHAR is the incorrect data type to be using > here. You should either be using INTERVAL or TIMESTAMP depending on > what you want. You can even combine date and time into a single > TIMESTAMP field. Only use VARCHAR when no other data type will d

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread Jeff Davis
On Tue, 2007-01-30 at 20:44 -0800, David Fetter wrote: > On Tue, Jan 30, 2007 at 04:43:14PM -0800, Richard Troy wrote: > > On Tue, 30 Jan 2007, Mark Walker wrote: > > > > > > I don't know. My customers expect 24/7 reliability. They expect > > > to be able to access their info anywhere in the worl

Re: [GENERAL] Ordering problem with varchar (DESC)

2007-01-31 Thread Brandon Aiken
As others have said, VARCHAR is the incorrect data type to be using here. You should either be using INTERVAL or TIMESTAMP depending on what you want. You can even combine date and time into a single TIMESTAMP field. Only use VARCHAR when no other data type will do. "SELECT * from t1;" is not a

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread Jorge Godoy
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > opinion it would be better to allow schemas to nest than to allow > cross database querying. Nested schemas would be great, indeed. But, on the other hand, being able to do queries in other databases would also help with partitioning and legacy syst

Re: [GENERAL] Ordering problem with varchar (DESC)

2007-01-31 Thread Erik Jones
Alexandre Leclerc wrote: Hi all, We have a column (varchar) that has plain text time and it is indexed. When I do a query with the index, all the data is in the right order, but when I user ORDER BY .. DESC, the order is messed up. Example: By index 1: (date, time, data) SELECT * from t1; date

Re: [GENERAL] Ordering problem with varchar (DESC)

2007-01-31 Thread Daniel Verite
Alexandre Leclerc wrote: > SELECT * from t1 ORDER BY date, time DESC; > date (date type) time (varchar) data > 2007-01-30 9h30 d2 > 2007-01-3017h20 d5 > 2007-01-3013h45 d4 > 2007-01-3012h00 d3 > 2007-01-17 8h

Re: [GENERAL] Ordering problem with varchar (DESC)

2007-01-31 Thread A. Kretschmer
am Wed, dem 31.01.2007, um 10:46:17 -0500 mailte Alexandre Leclerc folgendes: > Hi all, > > We have a column (varchar) that has plain text time and it is indexed. > > How can I fix that so that the result is exactly like the first one but > perfectly reversed in it's order? Use the right data-t

[GENERAL] Ordering problem with varchar (DESC)

2007-01-31 Thread Alexandre Leclerc
Hi all, We have a column (varchar) that has plain text time and it is indexed. When I do a query with the index, all the data is in the right order, but when I user ORDER BY .. DESC, the order is messed up. Example: By index 1: (date, time, data) SELECT * from t1; date (date type) time (varchar)

Re: [GENERAL] When an index and a constraint have the same name...

2007-01-31 Thread Tom Lane
"Jason L. Buberel" <[EMAIL PROTECTED]> writes: > Thanks for taking a look Tom: > I am running postgres 8.1.4 on RedHet (CentOS) v4.0. Here is the > description of the purchase_record table (somewhat abbreviated with > uninvolved columns omitted): Well, I was hoping I could duplicate the problem,

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Tom Lane
Geoffrey <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Please provide a stack trace from that coredump ... > It follows. Note, the references to /usr/local/pcm170/... are from a > 3rd party application we have built into our backend. I'm sure I know > what I'll hear regarding that issue. :)

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Tom Lane
DelGurth <[EMAIL PROTECTED]> writes: > Slightly OT. That documentation page of postgresql contains an invalid > example. Not sure if I should report it in here, but well, there you > go. > CREATE SEQUENCE serial START 101; > SELECT nextval('serial'); > nextval > - > 114 > So you sta

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Geoffrey
Tom Lane wrote: Geoffrey <[EMAIL PROTECTED]> writes: We are trying to track down an issue with our PostgreSQL application. We are running PostgreSQL 7.4.13 on Red Hat Enterprise ES 3. We have a situation where the postgres backend process drops core and dies. Please provide a stack trace fr

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread DelGurth
Slightly OT. That documentation page of postgresql contains an invalid example. Not sure if I should report it in here, but well, there you go. CREATE SEQUENCE serial START 101; SELECT nextval('serial'); nextval - 114 So you start at 101 and get 114, how nice ;-) Regards, Wessel van

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Tom Lane
Geoffrey <[EMAIL PROTECTED]> writes: > We are trying to track down an issue with our PostgreSQL application. > We are running PostgreSQL 7.4.13 on Red Hat Enterprise ES 3. > We have a situation where the postgres backend process drops core and > dies. Please provide a stack trace from that core

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread DelGurth
On 1/31/07, Geoffrey <[EMAIL PROTECTED]> wrote: We are trying to track down an issue with our PostgreSQL application. We are running PostgreSQL 7.4.13 on Red Hat Enterprise ES 3. We have a situation where the postgres backend process drops core and dies. We've tracked this to an unusual situati

Re: [GENERAL] DBMS Engines and Performance

2007-01-31 Thread Rich Shepard
On Wed, 31 Jan 2007, Mikael Carneholm wrote: I'm tired of teenage 1337 skill0rz PHP hackers who go "whoaah, 0ms!" after running "select count(*) from forum_posts" in a single thread (the developer himself testing his app), and then claim "MySQL rocks! I tested the postgres 7.1 that came with , b

Re: [GENERAL] Can a function be parameter in PL/PGSQL function?

2007-01-31 Thread Merlin Moncure
On 30 Jan 2007 12:32:04 -0800, Karen Hill <[EMAIL PROTECTED]> wrote: Is it possible to have a pl/pgsql function take another pl/pgsql function as one of the parameters? not exactly. you can take a string and execute it via dynamic sql, but this is going to cause problems with record and array t

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread Merlin Moncure
On 1/30/07, Tony Caduto <[EMAIL PROTECTED]> wrote: I know it can be done in M$ SQL server using .. notation and I bet you can do it in DB2 and Oracle. you can even do it in MySQL, in MySQL it's their way of implementing schemas. exactly. mysql does not have schemas, and imho schemas > mysql da

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Bill Moran
In response to Geoffrey <[EMAIL PROTECTED]>: > We are trying to track down an issue with our PostgreSQL application. > We are running PostgreSQL 7.4.13 on Red Hat Enterprise ES 3. > > We have a situation where the postgres backend process drops core and > dies. We've tracked this to an unusual

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Markus Schiltknecht
Hi, Geoffrey wrote: We are trying to track down an issue with our PostgreSQL application. We are running PostgreSQL 7.4.13 on Red Hat Enterprise ES 3. We have a situation where the postgres backend process drops core and dies. Are there some log messages of the dying process, especially jus

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Alban Hertroys
Geoffrey wrote: > We are trying to track down an issue with our PostgreSQL application. We > are running PostgreSQL 7.4.13 on Red Hat Enterprise ES 3. > > We have a situation where the postgres backend process drops core and > dies. We've tracked this to an unusual situation where a sequence valu

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Alvaro Herrera
Geoffrey wrote: > We are trying to track down an issue with our PostgreSQL application. > We are running PostgreSQL 7.4.13 on Red Hat Enterprise ES 3. > > We have a situation where the postgres backend process drops core and > dies. We've tracked this to an unusual situation where a sequence va

Re: [GENERAL] sequence skips 30 values, how?

2007-01-31 Thread A. Kretschmer
am Wed, dem 31.01.2007, um 7:43:05 -0500 mailte Geoffrey folgendes: > dies. We've tracked this to an unusual situation where a sequence value > that is being created during the process that is causing the core file > generation. The thing that is bizarre is that the sequence value skips > 30

[GENERAL] sequence skips 30 values, how?

2007-01-31 Thread Geoffrey
We are trying to track down an issue with our PostgreSQL application. We are running PostgreSQL 7.4.13 on Red Hat Enterprise ES 3. We have a situation where the postgres backend process drops core and dies. We've tracked this to an unusual situation where a sequence value that is being create

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/30/07 23:46, Paul Lambert wrote: > Richard Troy wrote: >> >> [snip] My observation is that we have a real shortage of >> quality [snip] >> Meanwhile, what Operating Systems ARE _today_ reliable choices >> upon which to run your Postgres databab

Re: [GENERAL] DBMS Engines and Performance

2007-01-31 Thread Karsten Hilbert
On Wed, Jan 31, 2007 at 09:57:21AM +0100, Mikael Carneholm wrote: > I'm tired of teenage 1337 skill0rz PHP hackers who go "whoaah, 0ms!" > after running "select count(*) from forum_posts" in a single thread (the > developer himself testing his app), and then claim "MySQL rocks! I > tested the post

Re: [GENERAL] DBMS Engines and Performance

2007-01-31 Thread Mikael Carneholm
>However, what puzzles me is this statement: "PostgreSQL has continued > to > fall behind other database engines in both performance and features, so I > don't see compelling reason to work on it in my very limited free time." http://pda.tweakers.net/?reviews/649 http://pda.tweakers.net/?revie

Re: [GENERAL] PostgreSQL 9.0

2007-01-31 Thread Bernd Helmle
On 30 Jan 2007 12:15:17 -0800, "Karen Hill" <[EMAIL PROTECTED]> wrote: > On Jan 29, 11:06 pm, [EMAIL PROTECTED] ("Dawid Kuroczko") wrote: > >> * updatable views [ or am I missing something? ] -- it seems to me >> they were close to be completed, but I don't remember if they were >> completed an

Re: [GENERAL] Any Plans for cross database queries on the same server?

2007-01-31 Thread David Fetter
On Tue, Jan 30, 2007 at 11:45:51PM -0600, Tony Caduto wrote: > David Fetter wrote: > >>That being said, I think it is a dumb feature. If you have data in > >>one database, that requires access to another database within the > >>same cluster. You designed your database incorrectly and should be > >>