Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-27 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > In some databases if you know that an index just happens to be unique > you might gain some query performance by defining the index as unique, > but I don't think the PostgreSQL planner is that smart. Actually, the planner only pays attention to whether

Re: [GENERAL] How to Kill IDLE users

2007-02-27 Thread Ang Chin Han
On 2/28/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: select procpid, usename, now()-query_start from pg_stat_activity where current_query like '%IDLE%' and now()-query_start > interval '5 minutes'; to list all the users that have been idle over the interval in the list. Using some kind of scr

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-27 Thread Jim C. Nasby
Adding -general back in. On Tue, Feb 27, 2007 at 07:19:15PM -0600, John Jawed wrote: > This is more or less correct, I was looking for performance gains on > the [possible] differences during DML and DDL. > > If Jim is correct, is there a particular reason that PostgreSQL does > not behave like o

[GENERAL] Re: [HACKERS] 5 Weeks till feature freeze or (do you know where your patch is?)

2007-02-27 Thread Kris Jurka
On Tue, 27 Feb 2007, Henry B. Hotz wrote: Question: are there any corresponding deadlines for the Java client code that I need to worry about? The JDBC driver will release a new version at the same time as the server, but we don't have nearly as strict rules about feature freeze/beta. We

[GENERAL] Re: [HACKERS] 5 Weeks till feature freeze or (do you know where your patch is?)

2007-02-27 Thread Joshua D. Drake
Henry B. Hotz wrote: > > On Feb 23, 2007, at 1:24 PM, Joshua D. Drake wrote: > >> Henry Hotz: GSSAPI (with Magnus) > > Progressing. Had hoped to have alpha patches by March 1, but I just got > handed a proposal that I have to do by then. I trust it's OK to send > the first version in next week

Re: [GENERAL] [HACKERS] 5 Weeks till feature freeze or (do you know where your patch is?)

2007-02-27 Thread Henry B. Hotz
On Feb 23, 2007, at 1:24 PM, Joshua D. Drake wrote: Henry Hotz: GSSAPI (with Magnus) Progressing. Had hoped to have alpha patches by March 1, but I just got handed a proposal that I have to do by then. I trust it's OK to send the first version in next week? No real issues, except I ha

Re: [GENERAL] How to debug this crash?

2007-02-27 Thread Jorge Godoy
Tom Lane <[EMAIL PROTECTED]> writes: > What python version? (Hint: pre-8.2 plpython is known not to work > with python 2.5) This is more to confirm what I've found in practice and couldn't find at the online docs for 8.2: is it possible to use output variables to write stored procedures in plpyt

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-27 Thread John Jawed
This is more or less correct, I was looking for performance gains on the [possible] differences during DML and DDL. If Jim is correct, is there a particular reason that PostgreSQL does not behave like other RDBMs without a SET ALL DEFERRED? Or is this a discussion best left for -HACKERS? On 2/27

Re: [GENERAL] Slony subscription problem

2007-02-27 Thread Joshua D. Drake
Joseph S wrote: > How come the slony list isn't on the nntp server? Likely because it is a affiliated project. Joshua D. Drake > > Martijn van Oosterhout wrote: > >> There's a mailing list for slony, you might have better luck there. >> >> http://gborg.postgresql.org/mailman/listinfo/slony1-ge

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-27 Thread Joshua D. Drake
John Jawed wrote: > Is there any difference as far as when the "uniqueness" of values is > checked in DML between a unique index vs a unique constraint? Or is > the only difference syntax between unique indices and constraints in > PostgreSQL? They are functionally the same and unique constraint w

Re: [GENERAL] Difference between UNIQUE constraint vs index

2007-02-27 Thread Jim C. Nasby
On Tue, Feb 27, 2007 at 06:43:51PM -0600, John Jawed wrote: > Is there any difference as far as when the "uniqueness" of values is > checked in DML between a unique index vs a unique constraint? Or is > the only difference syntax between unique indices and constraints in > PostgreSQL? Syntax only,

Re: [GENERAL] Slony subscription problem

2007-02-27 Thread Joseph S
How come the slony list isn't on the nntp server? Martijn van Oosterhout wrote: There's a mailing list for slony, you might have better luck there. http://gborg.postgresql.org/mailman/listinfo/slony1-general Have a nice day, ---(end of broadcast)-

[GENERAL] Difference between UNIQUE constraint vs index

2007-02-27 Thread John Jawed
Is there any difference as far as when the "uniqueness" of values is checked in DML between a unique index vs a unique constraint? Or is the only difference syntax between unique indices and constraints in PostgreSQL? John ---(end of broadcast)---

Re: [GENERAL] How often do I need to reindex tables?

2007-02-27 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/27/07 13:26, Dhaval Shah wrote: > I am planning to use 8.2 and the average inserts/deletes and updates > across all tables is moderate. That is, it is a moderate sized > database with moderate usage of tables. Moderate? -BEGIN PGP SIGNAT

Re: [GENERAL] How to Kill IDLE users

2007-02-27 Thread Scott Marlowe
On Tue, 2007-02-27 at 15:23, Goran Rakic wrote: > I have installed POSTGRESQL 8.2 on W2K3 32bit , 100 users connecting from > desktop applications and 200 users connecting thru web service from handheld > computers > > I have problem with second groups of users. > > Often they do not disconnect f

[GENERAL] Recovering from a corrupt database

2007-02-27 Thread Dhaval Shah
I am testing postgres for HA and at one stage I could not start the db. I get the following message: LOG: database system was shut down at 2007-02-22 16:07:51 PST LOG: could not open file "pg_xlog/0001000B" (log file 0, segment 11): No such file or directory LOG: invalid primar

[GENERAL] How to Kill IDLE users

2007-02-27 Thread Goran Rakic
I have installed POSTGRESQL 8.2 on W2K3 32bit , 100 users connecting from desktop applications and 200 users connecting thru web service from handheld computers I have problem with second groups of users. Often they do not disconnect from POSTGRE Server and with time passing thru I have lot of ID

Re: [GENERAL] grant on sequence and pg_restore/pg_dump problem

2007-02-27 Thread Bruce Momjian
Tony Caduto wrote: > Hi, > I did a quick search and didn't see anything on this, if I missed it > sorry in advance. > Anyway, I was doing a restore of a 8.1 database(on a 8.1 server) using > the 8.2 pg_restore and it was throwing errors when it was trying to > restore the permissions on the seque

Re: [GENERAL] How to use OIDs on tables......OR....a better solution?

2007-02-27 Thread Martijn van Oosterhout
On Tue, Feb 27, 2007 at 12:57:51PM -0700, Lenorovitz, Joel wrote: > The notes are attached to the records via a separate associative table > that contains the 'note_id', the 'record_id' (both generated by a > sequence), and the 'table_name' in which the record resides. It's > managable now, but my

[GENERAL] [ANN]VTD-XML 2.0

2007-02-27 Thread Jimmy Zhang
XimpleWare is proud to announce the release of version 2.0 of VTD-XML, the next generation XML parser/indexer. The new features introduced in this version are: * VTD+XML version 1.0: the world's first true native XML index that is simple, general-purpose and back-compatible with XML. * NodeRe

[GENERAL] How to use OIDs on tables......OR....a better solution?

2007-02-27 Thread Lenorovitz, Joel
Greetings, I have seen many a warning against using the Postgres internal OIDs to refer to DB objects, but I've got a situation that may warrant it. In a nutshell, I've got a table called 'Notes', which contains (you guessed it) notes that users can create to attach to various records in the DB.

Re: [GENERAL] How often do I need to reindex tables?

2007-02-27 Thread Jim C. Nasby
On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: > I am planning to use 8.2 and the average inserts/deletes and updates > across all tables is moderate. That is, it is a moderate sized > database with moderate usage of tables. > > Given that, how often do I need to reindex the tables?

Re: [GENERAL] pg_dump and restore problem with function as DEFAULT-Constraint

2007-02-27 Thread Andreas Kretschmer
Markus Schulz <[EMAIL PROTECTED]> schrieb: > > You can use pg_restore with -l to generate a listfile for all objects > > in the database. Then you can reorder this ($EDITOR) and then use -L > > to use this ordered listfile to enforce the right order of objects. I > > hope this helps you. > > thank

[GENERAL] How often do I need to reindex tables?

2007-02-27 Thread Dhaval Shah
I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is, it is a moderate sized database with moderate usage of tables. Given that, how often do I need to reindex the tables? Do I need to do it everyday? Also with 8.2, I do not have to do vacuu

Re: [GENERAL] How does filter order relate to query optimization?

2007-02-27 Thread Andrew Edson
I have now, over two of our setups, and I'm getting another, er, interesting problem. Same statement, same data, wildly different times. One's taking nearly half an hour, the other's ready within a few minutes. It's a rather large database, so I'm not surprised at a little delay (although sho

Re: [GENERAL] stored procedure optimisation...

2007-02-27 Thread Anton Melser
RAISE NOTICE 'I am here, and myvar = % and thatvar = %', myvar, thatvar; Thanks... it is indeed a gem that little instruction!!! Cheers Anton ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] pg_dump and restore problem with function as DEFAULT-Constraint

2007-02-27 Thread Markus Schulz
Am Dienstag, 27. Februar 2007 18:28 schrieb A. Kretschmer: > am Tue, dem 27.02.2007, um 17:44:06 +0100 mailte Markus Schulz folgendes: > > Hello, > > > > i have some trouble with dumping and restoring a database with > > postgresql 7.4.7-6sarge4 (debian sarge). > > Is the new database also 7.4? W

Re: [GENERAL] Unable to restore dump due to client encoding issues -- or, when is SQL_ASCII really UTF8

2007-02-27 Thread Bill Moran
In response to Tom Lane <[EMAIL PROTECTED]>: > Bill Moran <[EMAIL PROTECTED]> writes: > > In response to Michael Fuhr <[EMAIL PROTECTED]>: > >>> Connecting to the database and issuing "show client_encoding" shows that > >>> the database is indeed set to SQL_ASCII. > >> > >> client_encoding doesn'

Re: [GENERAL] How to debug this crash?

2007-02-27 Thread Jorge Godoy
Tom Lane <[EMAIL PROTECTED]> writes: > Jorge Godoy <[EMAIL PROTECTED]> writes: >> This is with: > >> OpenSuSE 10.2 >> postgresql-server-8.1.5-13 >> postgresql-libs-8.1.5-13 >> postgresql-docs-8.1.5-13 >> postgresql-devel-8.1.5-13 >> postgresql-8.1.5-13 >> postgresql-pl-8.1.5-15 > > What python ver

Re: [GENERAL] Building a record in a function

2007-02-27 Thread Richard Huxton
Robert Fitzpatrick wrote: Haven't done a whole lot of plsql returning records, only those based on a query. I was wondering, can I build a record from the results of the query using other values for some fields in the record? I know 'return next' requires a record and want to build my own record

Re: [GENERAL] pg_dump and restore problem with function as DEFAULT-Constraint

2007-02-27 Thread Tom Lane
Markus Schulz <[EMAIL PROTECTED]> writes: > i have some trouble with dumping and restoring a database with > postgresql 7.4.7-6sarge4 (debian sarge). > ... > What can i do to enforce the order of plpgsql functions prior to all > table structures? Update to PG 8.x --- IIRC 8.0 was the first relea

Re: [GENERAL] pg_dump and restore problem with function as DEFAULT-Constraint

2007-02-27 Thread A. Kretschmer
am Tue, dem 27.02.2007, um 17:44:06 +0100 mailte Markus Schulz folgendes: > Hello, > > i have some trouble with dumping and restoring a database with > postgresql 7.4.7-6sarge4 (debian sarge). Is the new database also 7.4? Why not 8.1 oder 8.2? > > Some tables have plpgsql-functions as DEFAUL

[GENERAL] pg_dump and restore problem with function as DEFAULT-Constraint

2007-02-27 Thread Markus Schulz
Hello, i have some trouble with dumping and restoring a database with postgresql 7.4.7-6sarge4 (debian sarge). Some tables have plpgsql-functions as DEFAULT contraints. But these functions are dumped after the CREATE TABLE command. Now these tables can't be created on restore. If i'm dumping

Re: [GENERAL] select ARRAY[1,4,3] @> ARRAY[3,1] gives ERROR: operator does not exist: integer[] @> integer[] ???

2007-02-27 Thread David Gagnon
Dam! my computer rebooted and restarted the old 8.1 postmaster... Thanks for your help. Sorry for the noise. Best Regards David -Message d'origine- De : Tom Lane [mailto:[EMAIL PROTECTED] Envoyé : Tuesday, February 27, 2007 11:02 AM À : David Gagnon Cc : pgsql-general@postgresql.org O

Re: [GENERAL] How to debug this crash?

2007-02-27 Thread Tom Lane
Jorge Godoy <[EMAIL PROTECTED]> writes: > This is with: > OpenSuSE 10.2 > postgresql-server-8.1.5-13 > postgresql-libs-8.1.5-13 > postgresql-docs-8.1.5-13 > postgresql-devel-8.1.5-13 > postgresql-8.1.5-13 > postgresql-pl-8.1.5-15 What python version? (Hint: pre-8.2 plpython is known not to work

[GENERAL] Building a record in a function

2007-02-27 Thread Robert Fitzpatrick
Haven't done a whole lot of plsql returning records, only those based on a query. I was wondering, can I build a record from the results of the query using other values for some fields in the record? I know 'return next' requires a record and want to build my own record to include some argument val

Re: [GENERAL] Unable to restore dump due to client encoding issues -- or, when is SQL_ASCII really UTF8

2007-02-27 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > In response to Michael Fuhr <[EMAIL PROTECTED]>: >>> Connecting to the database and issuing "show client_encoding" shows that >>> the database is indeed set to SQL_ASCII. >> >> client_encoding doesn't show the database encoding, it shows the >> client encod

Re: [GENERAL] select ARRAY[1,4,3] @> ARRAY[3,1] gives ERROR: operator does not exist: integer[] @> integer[] ???

2007-02-27 Thread Tom Lane
"David Gagnon" <[EMAIL PROTECTED]> writes: > I tried select ARRAY[1,4,3] @> ARRAY[3,1] in pgAdminIII and get an error. > ... > Thanks to point me what I'm doing wrong or how to fix this :-/ Don't use the 8.2 manuals as a guide to an 8.1 or older PG? That operator is new in 8.2.

Re: [GENERAL] Unable to restore dump due to client encoding issues -- or, when is SQL_ASCII really UTF8

2007-02-27 Thread Michael Fuhr
On Tue, Feb 27, 2007 at 10:31:47AM -0500, Bill Moran wrote: > The database was, indeed, UTF8, which is the default on newer Postgres. initdb determines the encoding from your environment. If you're on a Unix-like platform run "env | grep UTF" and you'll probably see that LANG and/or LC_* is set t

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-27 Thread Tom Lane
George Nychis <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> While neither number >> is exactly awe-inspiring, I'm not seeing why you think the DROP is >> particularly broken? >> > Then maybe it's a bug in my version of postgresql, what version are you > using? I tried it on HEAD and 8.2 and

[GENERAL] select ARRAY[1,4,3] @> ARRAY[3,1] gives ERROR: operator does not exist: integer[] @> integer[] ???

2007-02-27 Thread David Gagnon
Hi all, I tried select ARRAY[1,4,3] @> ARRAY[3,1] in pgAdminIII and get an error. This example comes directly from the postgresql manual section: 9.14. Array Functions and Operators. Did I screw up something ? I tried on a 8.1 postgreql and get the same error. ERROR: operator does not exist:

Re: [GENERAL] Unable to restore dump due to client encoding issues -- or, when is SQL_ASCII really UTF8

2007-02-27 Thread Bill Moran
In response to Michael Fuhr <[EMAIL PROTECTED]>: [snip] > > The beginning of the dump file I am restoring has the following: > > -- > > -- PostgreSQL database dump > > -- > > > > SET client_encoding = 'SQL_ASCII'; > > [...] > > > > But when I try to pull the dump in with psql, I get the followi

Re: [GENERAL] performance of partitioning?

2007-02-27 Thread George Nychis
George Nychis wrote: cedric wrote: Le mardi 27 février 2007 15:00, George Nychis a écrit : Hey all, So I have a master table called "flows" and 400 partitions in the format "flow_*" where * is equal to some epoch. Each partition contains ~700,000 rows and has a check such that 1 field is

Re: [GENERAL] How does filter order relate to query optimization?

2007-02-27 Thread Tom Lane
Andrew Edson <[EMAIL PROTECTED]> writes: > I'm working on a php project that's supposed to draw information from the DB > for display, and I've been requested to speed up the display as much as > possible. I'm drawing data from four tables, with an additional two that I > have to 'bounce' throu

[GENERAL] How to debug this crash?

2007-02-27 Thread Jorge Godoy
Hi! I've updated my system and after importing some old data I started getting this message: *** glibc detected *** postgres: godoy neo localhost(34476) SELECT: double free or corruption (out): 0x08494440 ***

Re: [GENERAL] Unable to restore dump due to client encoding issues -- or, when is SQL_ASCII really UTF8

2007-02-27 Thread Michael Fuhr
On Tue, Feb 27, 2007 at 08:43:27AM -0500, Bill Moran wrote: > First off, it's my understanding that with SQL_ASCII "encoding", that > PostgreSQL does no checking for valid/invalid characters, per the docs: > http://www.postgresql.org/docs/8.2/static/multibyte.html Correct. As the documentation sa

Re: [GENERAL] performance of partitioning?

2007-02-27 Thread George Nychis
cedric wrote: Le mardi 27 février 2007 15:00, George Nychis a écrit : Hey all, So I have a master table called "flows" and 400 partitions in the format "flow_*" where * is equal to some epoch. Each partition contains ~700,000 rows and has a check such that 1 field is equal to a value: "f

Re: [GENERAL] performance of partitioning?

2007-02-27 Thread cedric
Le mardi 27 février 2007 15:00, George Nychis a écrit : > Hey all, > > So I have a master table called "flows" and 400 partitions in the format > "flow_*" where * is equal to some epoch. > > Each partition contains ~700,000 rows and has a check such that 1 field is > equal to a value: > "flows_

Re: [GENERAL] performance of partitioning?

2007-02-27 Thread Jorge Godoy
George Nychis <[EMAIL PROTECTED]> writes: > Hey all, > > So I have a master table called "flows" and 400 partitions in the format > "flow_*" where * is equal to some epoch. > > Each partition contains ~700,000 rows and has a check such that 1 field is > equal to a value: >"flows_1107246900_int

[GENERAL] performance of partitioning?

2007-02-27 Thread George Nychis
Hey all, So I have a master table called "flows" and 400 partitions in the format "flow_*" where * is equal to some epoch. Each partition contains ~700,000 rows and has a check such that 1 field is equal to a value: "flows_1107246900_interval_check" CHECK ("interval" = '2005-02-01 03:35:0

[GENERAL] How does filter order relate to query optimization?

2007-02-27 Thread Andrew Edson
I'm working on a php project that's supposed to draw information from the DB for display, and I've been requested to speed up the display as much as possible. I'm drawing data from four tables, with an additional two that I have to 'bounce' through to match the keys together. Also, I've got fi

[GENERAL] Unable to restore dump due to client encoding issues -- or, when is SQL_ASCII really UTF8

2007-02-27 Thread Bill Moran
I'm probably missing something painfully obvious here, but it's not obvious to me ... I've pulled a dump of a production database to put it in our lab for various types of testing ... I'm glad I did, as this testing is telling me we'll have issues if we try to upgrade. First off, it's my underst

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-27 Thread George Nychis
Tom Lane wrote: George Nychis <[EMAIL PROTECTED]> writes: Here is an exact script which generates this every single time... After you're done running the ruby script: DROP TABLE testflows CASCADE; I tweaked the ruby script to emit the SQL commands into a script file, which proved to issue 17

[GENERAL] Bad performace of a query

2007-02-27 Thread Rafa Comino
I have this query: SELECT DISTINCT isbn, CURRENT_TIMESTAMP, 1 FROM librosdisponibilidadtemp WHERE proceso = ai_proceso AND gen_isbn_pais(isbn) IN (SELECT pais FROM raizpaises) AND NOT EXISTS ( SELECT isbn

Re: [GENERAL] stored procedure optimisation...

2007-02-27 Thread Albe Laurenz
Anton Melser wrote: > I need to analyse some html to get some links out, and with only 25 > lines in exports_tmp_links (and text_to_parse no more than around > 10KB) this function has taken 10 minutes and counting. Something > horribly wrong is going on here! Can someone give me any pointers? I be

[GENERAL] SQL names for C constants

2007-02-27 Thread Vegard Bønes
Hi! I am writing a serverside function in plpgsql, which returns a part of a large object. To solve this problem I can do something like this: fd := lo_open( some_oid, 262144 ); PERFORM lo_lseek( fd, index, 0 ); RETURN loread( fd, read_size ); This works well enough, but I do feel slightly u

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-27 Thread Tom Lane
George Nychis <[EMAIL PROTECTED]> writes: > Here is an exact script which generates this every single time... > After you're done running the ruby script: > DROP TABLE testflows CASCADE; I tweaked the ruby script to emit the SQL commands into a script file, which proved to issue 1765 CREATE TABLE