Re: [GENERAL] PostgreSQL's XML support comparison against other RDBMSes

2006-04-03 Thread Tino Wildenhain
Ted Byers schrieb: May I ask a question about this? I will be working on an older database in which the original developer stored XML documents as a single variable length text field. To process it, it has to be retrieved in full and parsed. But the structure of it is simple in that it has

Re: [GENERAL] pgpool ABORT + no transaction warning

2006-04-03 Thread Tatsuo Ishii
The problem is not reproduced here. Do you have any idea how to reproduce it? -- Tatsuo Ishii SRA OSS, Inc. Japan > On Apr 1, 2006, at 8:01 AM, Tatsuo Ishii wrote: > > >> A while back, I posted about seeing a number of warnings from pgpool: > >> > >> http://archives.postgresql.org/pgsql-admin/200

[GENERAL] pl/pgsql uniq varchar[] sort?

2006-04-03 Thread Matthew Peter
Hello list. I'm trying to get a unique, sorted varchar array in pl/pgsql. Essentially a "group by" and "order by"'d varchar[]. Anyone got any ideas or point me in the right direction? Thanks. New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Re: [GENERAL] Grouping aggregate functions

2006-04-03 Thread Richard Connamacher
Thanks! That did the trick. SELECT avg(minprice) FROM (SELECT min(price) as minprice FROM weekly_supply_prices GROUP BY month ); This came up with an error too, but it pointed me in the right direction and was easy to fix. I needed to use an alias for the entire subquery too, so what f

Re: [GENERAL] MediaWiki and Postgresql?

2006-04-03 Thread Markus Wollny
Hi [EMAIL PROTECTED] wrote: > Has anyone put MediaWiki up using the current version of Postgresql? I have, although our Mediawiki installation is currently not openly accessible. Can't say that it went like a breeze, but the obstacles where more or less minor and writing a little custom auth-plu

[GENERAL] how to create script of database in postgres..sql(winxp)

2006-04-03 Thread deepak pal
hi   i am trying to make script file for my database by using pg_dump in windows as u say i open psql to postgres  then a prompt postgres# open then i write \i pg_dump it shows error.what should i do...plz hepl  

[GENERAL] Encoding problem in psql (Windows)

2006-04-03 Thread Markus Reinhold
Hej, though there are a few posts in the mailing lists archive with similar or the same error messages, I couldn't find a solution for my problem with psql there. So here's my encoding issue: I'm using a fresh install of 8.1.3 on a German Windows 2000. I have set the codepage (1252) and font (Lucid

Re: [GENERAL] how to create script of database in postgres..sql(winxp)

2006-04-03 Thread A. Kretschmer
am 03.04.2006, um 17:20:56 +0530 mailte deepak pal folgendes: > hi > i am trying to make script file for my database by using pg_dump in If you want to write your own scriptfiles, you should better use a editor for this. > windows as u say i open psql to postgres then a prompt postgres# open

Fwd: [GENERAL] how to create script of database in postgres..sql(winxp)

2006-04-03 Thread Tomi NA
-- Forwarded message --From: deepak pal <[EMAIL PROTECTED]>Date: Apr 3, 2006 2:05 PM Subject: Re: [GENERAL] how to create script of database in postgres..sql(winxp)To: Tomi NA <[EMAIL PROTECTED]>it do not recognize that \i and pg_dump i use \i pg_dump mydbname>newdb command From the

Re: [GENERAL] Creating serial ID on Windows.

2006-04-03 Thread Robert Treat
On Monday 27 March 2006 19:32, Chris wrote: > Ardian Xharra (Boxxo) wrote: > > I'm having some troubles restoring a database on Windows and I found > > this difference between PostgreSQL running on Linux and Windows. > > When I create a table like this: > > CREATE TABLE fee_payment1(id_fee_payment1

Re: [GENERAL] how to create script of database in postgres..sql(winxp)

2006-04-03 Thread Robert Treat
On Monday 03 April 2006 07:50, deepak pal wrote: > hi > i am trying to make script file for my database by using pg_dump in > windows as u say i open psql to postgres then a prompt postgres# open then > i write \i pg_dump it shows error.what should i do...plz hepl you need to use the pg

Re: [GENERAL] Performance Killer 'IN' ?

2006-04-03 Thread Kai Hessing
Marko Kreen wrote: > On 3/31/06, Kai Hessing <[EMAIL PROTECTED]> wrote: >> The second one (UPDATE xyz WHERE id IN (xyz1, xyz2, ) AND >> status>-1;) returns: >> -- >> Seq Scan on phon (cost=0.00..1573304.58 rows=105931 width=148) (actual >> time=369563.565..369563.565 rows=0 loo

Re: [GENERAL] Performance Killer 'IN' ?

2006-04-03 Thread Kai Hessing
Tom Lane wrote: > Kai Hessing <[EMAIL PROTECTED]> writes: >> Index Scan using phon_phon_idx on phon (cost=0.00..5193.83 rows=530 >> width=148) (actual time=0.146..0.146 rows=0 loops=1) >> ... >> Seq Scan on phon (cost=0.00..1573304.58 rows=105931 width=148) (actual >> time=369563.565..369563.565

[GENERAL] what is this error

2006-04-03 Thread venu gopal
Dear List,    I have created a database called dhis13 and created a login role with user name venu and pwd gis now i have created an sql file using shp2pgsql command it worked successfully when i m importing the same to the dhis13 database i was giving with the following error all the database and

Re: [GENERAL] what is this error

2006-04-03 Thread A. Kretschmer
am 03.04.2006, um 13:40:45 + mailte venu gopal folgendes: > Dear List, > I have created a database called dhis13 and created a login role with > user name venu and pwd gis now i have created an sql file using shp2pgsql > command it worked successfully when i m importing the same to the d

Re: [GENERAL] what is this error

2006-04-03 Thread chris smith
On 4/3/06, venu gopal <[EMAIL PROTECTED]> wrote: > > Dear List, > I have created a database called dhis13 and created a login role with > user name venu and pwd gis now i have created an sql file using shp2pgsql > command it worked successfully when i m importing the same to the dhis13 > databa

Re: [GENERAL] Performance Killer 'IN' ?

2006-04-03 Thread Marko Kreen
On 4/3/06, Kai Hessing <[EMAIL PROTECTED]> wrote: > Marko Kreen wrote: > > Just a shot in the dark: does the plan stay the same, > > when you remove the ' AND status > -1' ? > > No difference: I skipped the 'AND status > -1' and have the following > results... Ok. Thanks. I once had similar quer

Re: [GENERAL] Performance Killer 'IN' ?

2006-04-03 Thread Tom Lane
Kai Hessing <[EMAIL PROTECTED]> writes: > Yes... The 0 rows are there because I did the command before. Now I > resetted the test database to a previous state and dopped the 'AND > status>-1' in the SQL-syntax: > Using the 'UPDATE xyz WHERE id IN ('xyz1', 'xyz2', other 2000 > values.)' returns

[GENERAL] database design questions

2006-04-03 Thread Ottavio Campana
Hello, I'm designing a database and I'm having some problems, so I ask you a suggestion. 1) The database I'm going to develop is a big list with a catalog of items and I want to store subsets of this list representing the available items in several places. My idea is to create the big

Re: [GENERAL] database design questions

2006-04-03 Thread Tomi NA
On 4/3/06, Ottavio Campana <[EMAIL PROTECTED]> wrote:  3) faq 4.11.1 says>CREATE TABLE person (>id   SERIAL,>name TEXT>);>>is automatically translated into this:>>CREATE SEQUENCE person_id_seq; >CREATE TABLE person (>id   INT4 NOT NULL DEFAULT nextval('person

Re: [GENERAL] How to delete all operators

2006-04-03 Thread William Leite Araújo
  You can make a function to do this.  CREATE FUNCTION drop_operators(text) RETURNS BOOL AS   $$  DECLARE    op record;  BEGIN    FOR op IN SELECT opname FROM pg_operator as o left join pg_namespace as n on (o.oprnamespace = n.oid) WHERE nspname = $1

Re: [GENERAL] pl/pgsql uniq varchar[] sort?

2006-04-03 Thread Merlin Moncure
On 4/3/06, Matthew Peter <[EMAIL PROTECTED]> wrote: > > Hello list. I'm trying to get a unique, sorted varchar array in pl/pgsql. > Essentially a "group by" and "order by"'d varchar[]. > > Anyone got any ideas or point me in the right direction? Thanks. If your data is not an array type coming o

Re: [GENERAL] database design questions

2006-04-03 Thread Richard Broersma Jr
--- Tomi NA <[EMAIL PROTECTED]> wrote: > On 4/3/06, Ottavio Campana <[EMAIL PROTECTED]> wrote: > > > > 3) faq 4.11.1 says > > > > >CREATE TABLE person ( > > >id SERIAL, > > >name TEXT > > >); > > > > > >is automatically translated into this: > > > > > >CREATE SEQU

Re: [GENERAL] database design questions

2006-04-03 Thread Keary Suska
on 4/3/06 7:38 AM, [EMAIL PROTECTED] purportedly said: > 1) The database I'm going to develop is a big list with a catalog of > items and I want to store subsets of this list representing the > available items in several places. > > My idea is to create the big table with all the element

[GENERAL] RAISE function misuse ?

2006-04-03 Thread Patrick Refondini
Hi, I obtain the following output: idns_target=# select test(); INFO: hello ! CONTEXT: SQL statement "SELECT hello()" PL/pgSQL function "test" line 2 at perform Using the two following functions: CREATE OR REPLACE FUNCTION hello() RETURNS void AS $$ BEGIN RAISE INFO 'hello !'; RETURN

Re: [GENERAL] database design questions

2006-04-03 Thread Alban Hertroys
Ottavio Campana wrote: CREATE TABLE person ( id SERIAL, name TEXT ); how can I do it with a INT8 instead of a INT4? Do you really expect that sequence to reach over 2 billion? Otherwise I'd stick with the SERIAL, nothing wrong with that unless you're selling electrons sep

Re: [GENERAL] database design questions

2006-04-03 Thread Alex Turner
create table person (id serial8,name text);AlexOn 4/3/06, Alban Hertroys <[EMAIL PROTECTED] > wrote:Ottavio Campana wrote:>>   CREATE TABLE person (>>   id   SERIAL, >>   name TEXT>>   );> how can I do it with a INT8 instead of a INT4?Do you really expect that sequence to reach over 2 billi

Re: [GENERAL] pg 8.1.2 performance issue

2006-04-03 Thread Vivek Khera
On Mar 31, 2006, at 1:51 PM, Ed L. wrote: This indeed appears to be locking problem from within Apache::Session where it deletes a row from the DB but fails to commit the change for an extended period while another And you should read well the notes in the Pg driver for Apache::Session wher

Re: [GENERAL] database design questions

2006-04-03 Thread Don Y
Alban Hertroys wrote: Ottavio Campana wrote: CREATE TABLE person ( id SERIAL, name TEXT ); how can I do it with a INT8 instead of a INT4? Do you really expect that sequence to reach over 2 billion? Otherwise I'd stick with the SERIAL, nothing wrong with that unless you're

Re: [GENERAL] pgpool ABORT + no transaction warning

2006-04-03 Thread Thomas F. O'Connell
On Apr 3, 2006, at 3:05 AM, Tatsuo Ishii wrote: The problem is not reproduced here. Do you have any idea how to reproduce it? If I did, I'd resolve it. :P I suppose I can try restarting the connection pools on this server just to see what happens. If I am able to do that, I will post the

Re: [GENERAL] pgsql and streams

2006-04-03 Thread Christopher Condit
OK - Now I see the COPY patch, adding the CopyManager class to the jdbc driver. This is exactly the functionality I'm looking for. Has anyone gotten this to work with the latest codebase? Is there a new patch available? Thanks for your help, Chris -Original Message- From: Tino Wildenh

Re: [GENERAL] Performance Killer 'IN' ?

2006-04-03 Thread Kai Hessing
Tom Lane wrote: > Well, here's our problem it would seem: the planner is estimating the IN > clause to match 317227 rows, rather than the actual 2522. That's > naturally going to bias it against choosing an indexscan. You need to > get that estimate closer before there's going to be much chance o

[GENERAL] Which error constant to use for "permission deny error when updating a table that user is not allowd to "

2006-04-03 Thread Emi Lu
Hello, I am trying to catch permission denied exception. For example, user 1 is not allowed to update table 2, when user1 updated table 2 there is a permission excetpion. In http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html, I tried "modifying_sql_data_not_permitted" , "sql_rou

Re: [GENERAL] Which error constant to use for "permission deny error when updating a table that user is not allowd to "

2006-04-03 Thread William Leite Araújo
Why doesn't test before update? IF EXISTS( SELECT * FROM information_schema.table_privileges WHERE grantee = '1' AND table_name = '2' AND privilege_type = 'UPDATE') THEN ... ELSE ... END IF;On 4/3/06, Emi Lu <[EMAIL PROTECTED]> wrote: Hello,I am trying to catch per

[GENERAL] Log Slow Queries

2006-04-03 Thread MaRCeLO PeReiRA
Hi Guys, Is there a feature in PostgreSQL like "--log-slow-queries"(MySQL) ??? Regards, Marcelo P. ___ Abra sua conta no Yahoo! Mail: 1GB de espaço, alertas de e-mail no celular e anti-spam realmente eficaz. http://br.info.

Re: [GENERAL] PSQL Data Type: text vs. varchar(n)

2006-04-03 Thread Kris Jurka
On Thu, 30 Mar 2006, kurt _ wrote: I am having a problem with Sun Java Studio Creator because the latest version of the JDBC driver returns a field length of -1 for text fields. You should try the latest development driver, 8.2dev-501. Kris Jurka ---(end of broadca

Re: [GENERAL] Postgresql string parsing

2006-04-03 Thread Jim Nasby
On Mar 29, 2006, at 12:19 PM, Tony Caduto wrote: [EMAIL PROTECTED] wrote: Hi Folks, I'm looking for the fatest way to parse string in a postgresql function and insert each parsed chunk in a table. Something like that: You might be able to use the |string_to_array function which | splits

Re: [GENERAL] Create an index with a sort condition

2006-04-03 Thread Jim Nasby
On Mar 29, 2006, at 2:57 PM, Simon Riggs wrote: On Wed, 2006-03-29 at 03:14 -0800, sylsau wrote: I use PostgreSQL 8.1 and I would like create and index on a table's field with a sort condition on this field. For example, I have a table named books and I want create an index on the fields title

Re: [GENERAL] Comparing 7.4 with 8.0

2006-04-03 Thread Jim Nasby
On Mar 29, 2006, at 12:58 PM, Reimer wrote: Hello, We would like to have only one PostgreSQL version at our clients, currently some are using 7.4.6 and others 8.0.6. The first thing is to migrate those 7.4.6 clients to 8.0.6. But before, I´ve to convince them that such migration will be

Re: [GENERAL] PSQL Data Type: text vs. varchar(n)

2006-04-03 Thread Jim Nasby
On Mar 31, 2006, at 12:51 AM, Tom Lane wrote: Well, if you are looking for the lowest-common-denominator textual column datatype, then varchar(255) is probably it ... I think even Bill Gates would feel ashamed to sell a database that could not handle that. But my reading of the OP's question

Re: [GENERAL] How to delete all operators

2006-04-03 Thread Jim Nasby
On Mar 31, 2006, at 5:17 AM, Martin Pohl wrote: Is there any way to drop all operators (given they are all in the schema "public) in a script? Something like (pseudocode): Drop all operators in schema "public" Nope, though information_schema or the newsysviews project on pgFoundry might ma

Re: [GENERAL] FAQ 1.1

2006-04-03 Thread Jim Nasby
On Mar 31, 2006, at 4:17 AM, Dave Page wrote: Given the tendency people have to remove the capitalised bits to get 'postgre', we'd probably end up with 'ostres' Man I hate when people do that. I think we should just rename the database to 'Fred'. :) -- Jim C. Nasby, Sr. Engineering Consultant

Re: [GENERAL] Getting more information about errorcodes such as when these error1 happen

2006-04-03 Thread Jim Nasby
On Mar 29, 2006, at 11:13 AM, Emi Lu wrote: I found errorcodes info here: http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html But I am afraid that I could not imagine when and under what possible circumstances some errorcodes may happen just by their names such as : locator_exce

Re: [GENERAL] Log Slow Queries

2006-04-03 Thread Chris
MaRCeLO PeReiRA wrote: Hi Guys, Is there a feature in PostgreSQL like "--log-slow-queries"(MySQL) ??? Unfortunately not. What you can do is edit your postgresql.conf file and set: log_min_duration_statement See http://www.postgresql.org/docs/8.1/interactive/runtime-config-logging.html#RUNT

[GENERAL] Database restoration performance issue on PostgreSQL 7.4.7

2006-04-03 Thread Leon Pu
Hi all, the database restoration on my PosgreSQL 7.4.7 Linux installation is terribly poor. It takes more than one and half hour to restore a 61M restored database. Here are my commands to backup and restore. - backup: pg_dump -d $DB_NAME > db.bak - restore: psql -d $DB_NAME < db.bak Is the pro

[GENERAL] what datatype is for autonumbering.in postgress

2006-04-03 Thread deepak pal
hi i have to make ine field autonumber field what datatype should be used..?? plz reply meee.. On 4/3/06, William Leite Araújo <[EMAIL PROTECTED]> wrote: > You can make a function to do this. > > CREATE FUNCTION drop_operators(text) RETURNS BOOL AS > $$ > DECLARE > op record; >

Re: [GENERAL] Database restoration performance issue on PostgreSQL 7.4.7

2006-04-03 Thread Tom Lane
Leon Pu <[EMAIL PROTECTED]> writes: > the database restoration on my PosgreSQL 7.4.7 Linux installation is > terribly poor. It takes more than one and half hour to restore a 61M > restored database. > Here are my commands to backup and restore. > - backup: pg_dump -d $DB_NAME > db.bak > - restore

Re: [GENERAL] what datatype is for autonumbering.in postgress

2006-04-03 Thread Chris
deepak pal wrote: hi i have to make ine field autonumber field what datatype should be used..?? serial. http://www.postgresql.org/docs/8.1/interactive/datatype.html#DATATYPE-SERIAL -- Postgresql & php tutorials http://www.designmagick.com/ ---(end of broadcast)-

Re: [GENERAL] what datatype is for autonumbering.in postgress

2006-04-03 Thread A. Kretschmer
am 04.04.2006, um 10:07:58 +0530 mailte deepak pal folgendes: > hi > i have to make ine field autonumber field what datatype should be used..?? > plz reply meee.. You can use serial data types for this, read http://www.postgresql.org/docs/8.1/interactive/datatype.html#DATATYPE-SERIAL > On 4/3

Re: [GENERAL] FAQ 1.1

2006-04-03 Thread Chris Browne
[EMAIL PROTECTED] (Jim Nasby) writes: > On Mar 31, 2006, at 4:17 AM, Dave Page wrote: >> Given the tendency people have to remove the capitalised bits to get >> 'postgre', we'd probably end up with 'ostres' > > Man I hate when people do that. > > I think we should just rename the database to 'Fred'

Re: [GENERAL] Log Slow Queries

2006-04-03 Thread Martijn van Oosterhout
On Tue, Apr 04, 2006 at 12:25:09PM +1000, Chris wrote: > MaRCeLO PeReiRA wrote: > >Hi Guys, > > > >Is there a feature in PostgreSQL like > >"--log-slow-queries"(MySQL) ??? > > Unfortunately not. > > What you can do is edit your postgresql.conf file and set: > > log_min_duration_statement You ca

Re: [GENERAL] Create an index with a sort condition

2006-04-03 Thread Martijn van Oosterhout
On Mon, Apr 03, 2006 at 12:48:22PM -0400, Jim Nasby wrote: > I believe he's talking about something like > > CREATE INDEX books__id_title ON books(id_book, title DESC); > > which of course we don't support. But you can define a custom set of > operators that work backwards and use those to defi

Re: [GENERAL] Create an index with a sort condition

2006-04-03 Thread Tom Lane
Martijn van Oosterhout writes: > [ Q about reverse-sort opclasses ] > Well, if COLLATE support ever gets done, it'll fix this too and be SQL > compliant to boot. I keep having a nagging feeling that COLLATE is a completely inappropriate way to deal with reverse-sort semantics for non-textual dat

[GENERAL] CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks

2006-04-03 Thread Thomas F. O'Connell
I'm guessing that CREATE TABLE in itself doesn't take an ACCESS EXCLUSIVE lock because there's nothing yet to lock. But can CREATE TABLE ... INHERITS ... take an ACCESS EXCLUSIVE lock? Is it functioning as an ALTER TABLE? I'm dealing with an application that can potentially do ad hoc DDL.

Re: [GENERAL] CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks

2006-04-03 Thread Tom Lane
"Thomas F. O'Connell" <[EMAIL PROTECTED]> writes: > I'm dealing with an application that can potentially do ad hoc DDL. > It uses a PG/pgSQL function, and the only DDL statements in the > function are CREATE TABLE and CREATE INDEX statements. But I'm > noticing that during the backup process

Re: [GENERAL] Create an index with a sort condition

2006-04-03 Thread Martijn van Oosterhout
On Tue, Apr 04, 2006 at 01:40:52AM -0400, Tom Lane wrote: > Martijn van Oosterhout writes: > > [ Q about reverse-sort opclasses ] > > > Well, if COLLATE support ever gets done, it'll fix this too and be SQL > > compliant to boot. > > I keep having a nagging feeling that COLLATE is a completely >

Re: [GENERAL] Database restoration performance issue on PostgreSQL 7.4.7

2006-04-03 Thread Leon Pu
--- Tom Lane <[EMAIL PROTECTED]> wrote: > Leon Pu <[EMAIL PROTECTED]> writes: > > the database restoration on my PosgreSQL 7.4.7 Linux installation > is > > terribly poor. It takes more than one and half hour to restore a > 61M > > restored database. > > > Here are my commands to backup and resto