Re: [GENERAL] Question on inserting and querying at the same time.

2006-11-08 Thread Richard Huxton
Wei Weng wrote: I have a database table that has about 90k entries, they are all straightfoward text, and there is only one ID field that I use as primary key for this table. I have two threads working on this table. One of them inserting new content constantly, (about every second) another one

Re: [GENERAL] FOR ... IN

2006-11-08 Thread Alban Hertroys
Alain Roger wrote: Hi William, -- Function: SP_U_001(typeofarticle varchar) -- DROP FUNCTION SP_U_001(typeofarticle varchar); CREATE OR REPLACE FUNCTION SP_U_001(VARCHAR) RETURNS SETOF active_articles AS $BODY$ DECLARE myrec RECORD; res active_articles;

Re: [GENERAL] Stable sort?

2006-11-08 Thread Richard Huxton
redhog wrote: Is sorting in PostgreSQL stable over subqueries, that is, is select * from (select * from A order by x) as B order by y; equivalent with select * from A order by y, x; I don't see how it could be: SELECT * FROM (SELECT * FROM a ORDER BY x DESC) AS B ORDER BY x ASC; --

Re: [GENERAL] converting Informix outer to Postgres

2006-11-08 Thread Martijn van Oosterhout
On Tue, Nov 07, 2006 at 06:35:05PM -0500, [EMAIL PROTECTED] wrote: Hi all, I have been working on this Informix SQL query which has an outer join. I have attached Informix query and my supposedly solution to this query but I cannot get the same count. I appreciate for any help. Thanks. I

[GENERAL] Salir de la lista

2006-11-08 Thread Alcides Guillermo Alarcón Rojas
Hola; me gustaria salir de la lista podrias inhabilitarme por favor Saludos _ Charla con tus amigos en línea mediante MSN Messenger: http://messenger.latam.msn.com/ ---(end of

Re: [GENERAL] Stable sort?

2006-11-08 Thread redhog
I don't see how it could be: SELECT * FROM (SELECT * FROM a ORDER BY x DESC) AS B ORDER BY x ASC; That is a rather different query. My question was if the order of two elements whose internal order is not affected by the current ordering clause, still may change places due to

Re: [GENERAL] converting Informix outer to Postgres

2006-11-08 Thread H.J. Sanders
Hi. From some documentation: In INFORMIX SQL, outer tables are defined in the FROM clause with the OUTER keyword : SELECT ... FROM a, OUTER(b) WHERE a.key = b.akey SELECT ... FROM a, OUTER(b,OUTER(c)) WHERE a.key = b.akey AND b.key1 = c.bkey1 AND b.key2 =

Re: [GENERAL] converting Informix outer to Postgres

2006-11-08 Thread Gregory S. Williamson
Perhaps a more recent version of postgres (8.1 or mayber even look at 8.2 ...); lots of improvements since 7.1, IIRC in the area of joins specifically, but I don't know the answer to your question specifically. HTH, Greg Williamson (a [mostly] former Informix user, but not, alas, with such

Re: [GENERAL] WAL ends before end time of backup dump

2006-11-08 Thread Woody Woodring
Which Sunday? Could you have been bitten by some DST time shift? There were 2 1ams a couple of weeks ago. Woody IGLASS Networks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Davis Sent: Tuesday, November 07, 2006 5:38 PM To: Tom Lane Cc:

Re: [GENERAL] Stable sort?

2006-11-08 Thread Tom Lane
redhog [EMAIL PROTECTED] writes: My question was if the order of two elements whose internal order is not affected by the current ordering clause, still may change places due to technicalities. Postgres usually sorts using qsort(), which (on most platforms) is not stable in that sense.

Re: [GENERAL] Question on inserting and querying at the same time.

2006-11-08 Thread Erik Jones
Richard Huxton wrote: Wei Weng wrote: I have a database table that has about 90k entries, they are all straightfoward text, and there is only one ID field that I use as primary key for this table. I have two threads working on this table. One of them inserting new content constantly, (about

[GENERAL] killing autovac

2006-11-08 Thread Ed L.
Can I kill -SIGINT autovac in 8.1.2 without taking down all the other backends? Thanks, Ed ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

[GENERAL] Broken Plan? Nested Loop IN Join vs. Nested Loop/Hash Aggregate

2006-11-08 Thread Worky Workerson
I'm having an issue with a query plan that seems to be taking *far* longer than it should. I have the following schema (Note: I had to retype everything from an isolated lab, so I'm hoping that its correct enough to show my problem): CREATE TABLE ip_profiles ( ipIP4 PRIMARY KEY, --more

Re: [GENERAL] WAL ends before end time of backup dump

2006-11-08 Thread Jeff Davis
On Wed, 2006-11-08 at 09:39 -0500, Woody Woodring wrote: Which Sunday? Could you have been bitten by some DST time shift? There were 2 1ams a couple of weeks ago. Hah, interesting idea, but it wasn't that the basebackup didn't exist, and it wasn't that I had two of them close together. I

[GENERAL] 8.1.2 postmaster died

2006-11-08 Thread Ed L.
One of our 8.1.2 postmasters on HPUX 11.23 ia64 just received a SIGKILL signal from unknown origins. After reviewing all command history files for the DBA and root, I do not believe anyone manually sent it, and we have no scripts etc that would do that, at least that we can find or imagine.

[GENERAL] Table and Field namestyle best practices?

2006-11-08 Thread novnov
I'm new to pgsql, mostly coming from MSSQL. It sounds like it's simplest to keep field names lowercase with pgsql, so I will have to change some habits I've developed over the years. I would like to glean whatever collective wisdom I can here from experienced pgsql devs. I've been using

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-08 Thread Richard Broersma Jr
I've been using namestyles with mixed case like OrgID. That is much more readable than orgid. Probably a good convention to adopt would be to use namestyles like org_id. That change I can live with. According to recommended practice you have a choice to make. Here is what is described from the

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-08 Thread novnov
Yes, I've already pretty much decided to use lowercase for all namestyles, I mentioned that in the first post. Using lowercase invokes a set of other issues, which I'm asking for options on...namely, conventions like org_id, and emp_org_id, or simply using org_id as the fk pointer. Richard

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-08 Thread Alexander Staubo
On Nov 8, 2006, at 18:49 , novnov wrote: I've been using namestyles with mixed case like OrgID. That is much more readable than orgid. Probably a good convention to adopt would be to use namestyles like org_id. That change I can live with. Both are perfectly acceptable, though the

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-08 Thread Ed L.
On Wednesday November 8 2006 11:31 am, novnov wrote: Yes, I've already pretty much decided to use lowercase for all namestyles, I mentioned that in the first post. Using lowercase invokes a set of other issues, which I'm asking for options on...namely, conventions like org_id, and emp_org_id,

Re: [GENERAL] 8.1.2 postmaster died

2006-11-08 Thread Talha Khan
Hi Ed,You need to look through the log files for details.RegardsTalha KhanOn 11/8/06, Ed L. [EMAIL PROTECTED] wrote:One of our 8.1.2 postmasters on HPUX 11.23 ia64 just received a SIGKILL signal from unknown origins.After reviewing allcommand history files for the DBA and root, I do not

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-08 Thread Merlin Moncure
On 11/8/06, novnov [EMAIL PROTECTED] wrote: I'm new to pgsql, mostly coming from MSSQL. It sounds like it's simplest to keep field names lowercase with pgsql, so I will have to change some habits I've developed over the years. I would like to glean whatever collective wisdom I can here from

Re: [GENERAL] 8.1.2 postmaster died

2006-11-08 Thread Shoaib Mir
To be specific you need to look at the syslogs to see if it was actually some OOM killer or not.Thanks,---Shoaib MirEnterpriseDB (www.enterprisedb.com) On 11/9/06, Talha Khan [EMAIL PROTECTED] wrote: Hi Ed,You need to look through the log files for details.RegardsTalha KhanOn 11/8/06, Ed L.

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-08 Thread Ron Mayer
Merlin Moncure wrote: looks much better than OrgID. I suggest not prefixing tables with 'tbl', but idx_ for indexes and fk_ for foreign keys is ok. I've recently gotten into the habit of naming my indexes after exactly what they index. For example: create index foo(x,y,z) on foo(x,y,z); and

Re: [GENERAL] killing autovac

2006-11-08 Thread Tom Lane
Ed L. [EMAIL PROTECTED] writes: Can I kill -SIGINT autovac in 8.1.2 without taking down all the other backends? Should work fine. regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your free space

Re: [GENERAL] Broken Plan? Nested Loop IN Join vs. Nested Loop/Hash Aggregate

2006-11-08 Thread Tom Lane
Worky Workerson [EMAIL PROTECTED] writes: - Index Scan using ip_profiles_pkey on ip_profiles (cost=0.00..3.37 rows=1 width=4) (actual time=0.035..1195.567 rows=15 loops=1) Index Cond: ((ip '1.0.0.0'::ip4) AND (ip = '1.255.255.255)) Um ... have you ANALYZEd these

Re: [GENERAL] Stable sort?

2006-11-08 Thread Dann Corbit
-Original Message- From: [EMAIL PROTECTED] [mailto:pgsql-general- [EMAIL PROTECTED] On Behalf Of Tom Lane Sent: Wednesday, November 08, 2006 7:05 AM To: redhog Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Stable sort? redhog [EMAIL PROTECTED] writes: My question was

Re: [GENERAL] Table and Field namestyle best practices?

2006-11-08 Thread novnov
Thanks that some good real world input. Not sure what it'll add up to for me yet but good reference points. In the db centric world I've been inhabiting for these years there are many conventions re namestyles, they extend to table names, query names, field names, variables, everything. I

Re: [GENERAL] 8.1.2 postmaster died

2006-11-08 Thread Talha Khan
Hi Ed,I don't think its pgsql thats sending the SIGKILL its being done by the OS. The reason can only be confirmed after looking at your log files but the probability is that your OS ran out of memory and in order to protect itself it had to kill the processes that were taking a lot of memory thus

[GENERAL] 8.1.2 locking issues

2006-11-08 Thread Ed L.
We are having locking issues in 8.1.2 on HP 11.23 ia64. I'm trying to better understand how to conclusively identify who is waiting on who and why. We have a series of select for updates on our 'sessions' table. One of those queries is stuck waiting for a transactionid locktype ShareLock.

Re: [GENERAL] [solved] WAL ends before end time of backup dump

2006-11-08 Thread Jeff Davis
On Tue, 2006-11-07 at 17:20 -0500, Tom Lane wrote: Jeff Davis [EMAIL PROTECTED] writes: LOG: restored log file 00010017002B from archive LOG: record with zero length at 17/2B6EACC8 LOG: redo done at 17/2B6EAC84 It looks to me like you archived this log file before it was

Re: [GENERAL] 8.1.2 locking issues

2006-11-08 Thread Alvaro Herrera
Ed L. wrote: We are having locking issues in 8.1.2 on HP 11.23 ia64. I'm trying to better understand how to conclusively identify who is waiting on who and why. We have a series of select for updates on our 'sessions' table. One of those queries is stuck waiting for a transactionid

Re: [GENERAL] [solved] WAL ends before end time of backup dump

2006-11-08 Thread Tom Lane
Jeff Davis [EMAIL PROTECTED] writes: Would it make sense to throw an error if there's a recovery.conf and files already exist in pg_xlog? No; that's actually a feature in some scenarios (eg, your last few segments didn't get archived yet). There's no substitute for debugging your archiver

[GENERAL] How much memory is required?

2006-11-08 Thread Bill
Is there any published information on the minimum or recommended amount of memory for PostgreSQL on Windows and/or Linux. I am looking at PostgreSQL for an embedded app and hardware cost is a consideration. I cannot find anything in the PostgreSQL 8.1.0 Documentation but I may not be looking in

[GENERAL] Does PostgreSQL support multi-instancing?

2006-11-08 Thread Bill
Is is possible to have two different versions of PostgreSQL running on the same computer at the same time? -- .Bill. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] How much memory is required?

2006-11-08 Thread Bill Moran
In response to Bill [EMAIL PROTECTED]: Is there any published information on the minimum or recommended amount of memory for PostgreSQL on Windows and/or Linux. I am looking at PostgreSQL for an embedded app and hardware cost is a consideration. I cannot find anything in the PostgreSQL 8.1.0

Re: [GENERAL] Does PostgreSQL support multi-instancing?

2006-11-08 Thread Bill Moran
In response to Bill [EMAIL PROTECTED]: Is is possible to have two different versions of PostgreSQL running on the same computer at the same time? Yes, we have one server here that's doing it. It's neither easy nor difficult to set up ... it's somewhere in between ... -- Bill Moran

[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] 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] 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

Re: [GENERAL] Does PostgreSQL support multi-instancing?

2006-11-08 Thread Steve Atkins
On Nov 8, 2006, at 2:58 PM, Bill wrote: Is is possible to have two different versions of PostgreSQL running on the same computer at the same time? Yes. Works just fine. You might end up with some fun with applications finding the client libraries (generally better to let them all find the

Re: [GENERAL] 8.1.2 locking issues

2006-11-08 Thread Talha Khan
Hi Ed,In order to get which entities are responsible for the lock that you have try using the following query. select loc.pid , cls.relname,loc.granted as lock_status from pg_locks loc , pg_class cls where loc.locktype like '%sharelock%' and cls.oid=loc.relation and loc.pid in(pids of the process

Re: [GENERAL] How much memory is required?

2006-11-08 Thread Raymond O'Donnell
On 8 Nov 2006 at 22:48, Bill wrote: Is there any published information on the minimum or recommended amount of memory for PostgreSQL on Windows and/or Linux. I am looking There's some useful information here: http://www.powerpostgresql.com/PerfList HTH, --Ray.

[GENERAL] Performance monitoring

2006-11-08 Thread Bill
Can someone point me to information about performance monitoring in the PostgreSQL documentation? I want to see what tools are available to diagnose performance problems. Thanks. -- .Bill. ---(end of broadcast)--- TIP 9: In versions below 8.0, the

Re: [GENERAL] How much memory is required?

2006-11-08 Thread Bill
Raymond O'Donnell wrote: On 8 Nov 2006 at 22:48, Bill wrote: Is there any published information on the minimum or recommended amount of memory for PostgreSQL on Windows and/or Linux. I am looking There's some useful information here: http://www.powerpostgresql.com/PerfList HTH,

Re: [GENERAL] Does PostgreSQL support multi-instancing?

2006-11-08 Thread Steve Crawford
Bill wrote: Is is possible to have two different versions of PostgreSQL running on the same computer at the same time? It's easy to have two *instances* of postgresql running - they just need to have their own data directories and be configured to not conflict with each other (ie. listen on

Re: [GENERAL] Performance monitoring

2006-11-08 Thread Jeff Davis
On Wed, 2006-11-08 at 23:37 +, Bill wrote: Can someone point me to information about performance monitoring in the PostgreSQL documentation? I want to see what tools are available to diagnose performance problems. Thanks. http://www.postgresql.org/docs/8.1/static/monitoring.html Does

[GENERAL] PostgreSQL RPMs

2006-11-08 Thread Leonel Nunez
Hello : I've seen that the 8.1.5-6 rpms are available. Are those RPMs corrected from the announced bug ? Thanks Leonel ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Performance monitoring

2006-11-08 Thread Bill
Jeff Davis wrote: On Wed, 2006-11-08 at 23:37 +, Bill wrote: Can someone point me to information about performance monitoring in the PostgreSQL documentation? I want to see what tools are available to diagnose performance problems. Thanks.

[GENERAL] Can PostgreSQL notify a client that a trigger has fired?

2006-11-08 Thread Bill
Does PostgreSQL have built in mechanism I can use to conditionally notify a client application that a trigger has fired? What I want is something along the line of the following pseudo code in a trigger. if condition then raise client event -- .Bill. ---(end of

Re: [GENERAL] Can PostgreSQL notify a client that a trigger has

2006-11-08 Thread Jeff Davis
On Thu, 2006-11-09 at 00:39 +, Bill wrote: Does PostgreSQL have built in mechanism I can use to conditionally notify a client application that a trigger has fired? What I want is something along the line of the following pseudo code in a trigger. if condition then raise client event

Re: [GENERAL] Can PostgreSQL notify a client that a trigger has fired?

2006-11-08 Thread Jorge Godoy
Bill [EMAIL PROTECTED] writes: Does PostgreSQL have built in mechanism I can use to conditionally notify a client application that a trigger has fired? What I want is something along the line of the following pseudo code in a trigger. if condition then raise client event I have the

[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

Re: [GENERAL] [SQL] [ADMIN] Is there anyway to...

2006-11-08 Thread operationsengineer1
While you could setup a cron job to decrement some counter every day, I think that's not the best approach. Instead, I'd run a query once a day that finds all students that are past-due and takes some kind of action. -- Jim Nasby [EMAIL

[GENERAL] planer picks a bad plan (seq-scan instead of index) when adding an additional join

2006-11-08 Thread Thomas H.
hi list. as soon as i left-join an additional table, the query takes 24sec instead of 0.2sec, although the added fields have no impact on the resultset: SELECT * FROM shop.dvds LEFT JOIN oldtables.movies ON mov_id = dvd_mov_id WHERE (lower(mov_name) LIKE '%superman re%'

Re: [GENERAL] Can PostgreSQL notify a client that a trigger has fired?

2006-11-08 Thread Bill
Jorge Godoy wrote: I have the impression that you're missing a lot of sections in the manual... How about some time to re-read it? I don't know about you but for me a 1500 page manual is at least two weeks of full time reading.g I have read several sections of it but I am trying to decide if

Re: [GENERAL] Does PostgreSQL support multi-instancing?

2006-11-08 Thread Christopher Browne
After a long battle with technology, Bill [EMAIL PROTECTED], an earthling, wrote: Is is possible to have two different versions of PostgreSQL running on the same computer at the same time? Certainly. You need separate binaries, separate data directories, separate port configuration. If

[GENERAL] authentication question

2006-11-08 Thread Craig White
CentOS 4.4 which means postgresql-server-7.4.13-2.RHEL4.1 I'm starting to deal with the notion of allowing other users access (read only) to a db. Experimenting on my own db... hostall main_user 192.168.2.10255.255.255.0 trust hostall all 127.0.0.1

Re: [GENERAL] planer picks a bad plan (seq-scan instead of index)

2006-11-08 Thread mike
Have you run analyze on all the three tables since creating the database? What On Thu, 2006-11-09 at 02:31 +0100, Thomas H. wrote: hi list. as soon as i left-join an additional table, the query takes 24sec instead of 0.2sec, although the added fields have no impact on the resultset:

[GENERAL] reproducing this issue on PG 8.0.0 ERROR: index patient_pkey is not a btree

2006-11-08 Thread surabhi.ahuja
hi I am using Postgres 8.0.0 and we found this issue "ERROR: index "patient_pkey" is not a btree" I have been informed that we should shift to Postgres 8.0.9 I discussed this with my team member and they are asking if we can upgrade to the latest Postgres version i.e. 8.1.5 I have some

Re: [GENERAL] 8.1.2 postmaster died

2006-11-08 Thread Shoaib Mir
Have a look at 16.4.3. Linux Memory Overcommit on http://www.postgresql.org/docs/8.1/interactive/kernel-resources.htmlThanks, --Shoaib MirEnterpriseDB (www.enterprisedb.com)On 11/9/06, Talha Khan [EMAIL PROTECTED] wrote:Hi Ed,I don't think its pgsql thats sending the SIGKILL its being done by

Re: [GENERAL] planer picks a bad plan (seq-scan instead of index)

2006-11-08 Thread Thomas H.
Have you run analyze on all the three tables since creating the database? yes. even a forced ANALYZE FULL after the table loads: the tables were TRUNCATE'd, refilled and ANALYZE FULL'ed some minutes before the tests. there where no UPDATEs after the INSERTs... - thomas