[GENERAL] INSERT..RETURNING on a partitioned table

2007-04-12 Thread Leon Mergen
Hello, I'm attempting to convert a big table into smaller tables; I currently do a lot of INSERT .. RETURNING calls on the big table, which works perfectly. To convert the table into smaller tables, I have set up a test case of 3 tables, based on a 'CHECK ( hashtext(field) % 2 ) = -1' (or 0 or

[GENERAL] Providing user based previleges to Postgres DB

2007-04-12 Thread ramachandra.bhaskaram
Hi All, Currently in one of the projects we want to restrict the unauthorized users to the Postgres DB. Here we are using Postgres version 8.2.0 Can anybody tell me how can I provide the user based previleges to the Postgres DB so that, we can restrict the unauthorized users as well as

Re: [GENERAL] Kill session in PostgreSQL

2007-04-12 Thread Magnus Hagander
Beware that this is not a supported method, though. It often works, but don't make it a part of your regular maintenance. What you can do is use pg_cancel_query() to kick the session back out to IDLE - that's fully suported, and it will drop any locks the process has, so it shuold get rid of most

Re: [GENERAL] What about SkyTools?

2007-04-12 Thread Ivan Zolotukhin
I will test them intensively in coming weeks and report the results. I wrote an overview of the Skype PostgreSQL projects in Russian (will be published this week), so there will be more details available soon. In my opinion, SkyTools are worth testing, they look more interesting than Slony in

Re : [GENERAL] Dumping part (not all) of the data in a database...methods?

2007-04-12 Thread Laurent ROCHE
Hi, AFAIK, you can not do that with pg_dump ... but as you are working on only one table you can write the COPY command your self, and since version 8.2, you can write a SELECT query instead of a table name, like COPY (SELECT * FROM country WHERE country_name LIKE 'A%') TO

[GENERAL] Oracle mailing lists

2007-04-12 Thread Jan Mura
Hello, I am a little bit off Postgres but would like to know about some good Oracle mailing lists. I am looking something about backups and recovery things in Oracle I am not familiar with Thank you Jan Mura [EMAIL PROTECTED] ---(end of

[GENERAL] role passwords and md5()

2007-04-12 Thread Lutz Broedel
Dear list, I am trying to verify the password given by a user against the system catalog. Since I need the password hash later on, I can not just use the authentication mechanism for verification, but need to do this in SQL statements. Unfortunately, even if I set passwords to use MD5

Re: [GENERAL] [ADMIN] Increasing the shared memory

2007-04-12 Thread Sorin N. Ciolofan
Hello! I've tried first to increase the number of shared buffers, I doubled it, from 1000 to 2000 (16Mb) Unfortunately this had no effect. Then I increased the number of max_locks_per_transaction from 64 to 128 (these shoul

Re: [GENERAL] role passwords and md5()

2007-04-12 Thread Andrew Kroeger
Lutz Broedel wrote: Dear list, I am trying to verify the password given by a user against the system catalog. Since I need the password hash later on, I can not just use the authentication mechanism for verification, but need to do this in SQL statements. Unfortunately, even if I set

Re: [GENERAL] [ADMIN] Increasing the shared memory

2007-04-12 Thread Bill Moran
In response to Sorin N. Ciolofan [EMAIL PROTECTED]: I've tried first to increase the number of shared buffers, I doubled it, from 1000 to 2000 (16Mb) Unfortunately this had no effect. The difference between 8M and and 16M of shared buffers is pretty minor.

Re: [GENERAL] [ADMIN] Increasing the shared memory

2007-04-12 Thread Tom Lane
Sorin N. Ciolofan [EMAIL PROTECTED] writes: This had also no effect. Because I can't see any difference between the maximum input accepted for our application with the old configuration and the maximum input accepted now, with the new configuration. It looks like nothing

[GENERAL] digest data types?

2007-04-12 Thread Reece Hart
Does anyone have postgresql types for message digests, especially md5 and sha1? Obviously I could store these as text (as I currently do), but I'm particularly interested in custom types that store digests as binary blobs and provide conversion to/from text. Am I correct in assuming that the

Re: [GENERAL] SQL - finding next date

2007-04-12 Thread Raymond O'Donnell
On 11/04/2007 21:15, Jon Sime wrote: This is probably a very simple one, but I just can't see the answer and it's driving me nuts. I have a table holding details of academic terms, Many thanks indeed to all who replied - I particularly like Jeff's solution, and will use that one. Regards,

Re: [GENERAL] SQL - finding next date

2007-04-12 Thread Merlin Moncure
On 4/12/07, Raymond O'Donnell [EMAIL PROTECTED] wrote: On 11/04/2007 21:15, Jon Sime wrote: This is probably a very simple one, but I just can't see the answer and it's driving me nuts. I have a table holding details of academic terms, Many thanks indeed to all who replied - I particularly

Re: [GENERAL] Oracle mailing lists

2007-04-12 Thread Guy Rouillier
Jan Mura wrote: Hello, I am a little bit off Postgres but would like to know about some good Oracle mailing lists. A little bit off??? Use the forums on the Oracle Technology Network: http://www.oracle.com/technology//index.html -- Guy Rouillier ---(end of

Re: [GENERAL] SQL - finding next date

2007-04-12 Thread Merlin Moncure
On 4/12/07, Merlin Moncure [EMAIL PROTECTED] wrote: On 4/12/07, Raymond O'Donnell [EMAIL PROTECTED] wrote: On 11/04/2007 21:15, Jon Sime wrote: This is probably a very simple one, but I just can't see the answer and it's driving me nuts. I have a table holding details of academic terms,

[GENERAL] Autovac _scale_ settings not changed by SIGHUP?

2007-04-12 Thread Jerry Sievers
Perhaps I misunderstand something here. Autovac demon is configged on and working but was using standard settings which are commented out in postgresql.conf. The context field of pg_settings view suggests that the scale factor values and other autovac settings can be changed with SIGHUP.

Re: [GENERAL] SQL - finding next date

2007-04-12 Thread Raymond O'Donnell
On 12/04/2007 18:01, Merlin Moncure wrote: I tested it and this is much faster than 'where exists' solution. Is this an attribute of PostgreSQL in particular, or would it be true of RDBMSs in general? Thanks again, Ray. ---

Re: [GENERAL] Autovac _scale_ settings not changed by SIGHUP?

2007-04-12 Thread Tom Lane
Jerry Sievers [EMAIL PROTECTED] writes: Uncommenting the settings in postgresql.conf and giving the new values, then followed by a pg_reload_conf() call however and I see no change in the settings. Works for me ... regression=# show autovacuum_vacuum_scale_factor;

Re: [GENERAL] SQL - finding next date

2007-04-12 Thread Merlin Moncure
On 4/12/07, Raymond O'Donnell [EMAIL PROTECTED] wrote: On 12/04/2007 18:01, Merlin Moncure wrote: I tested it and this is much faster than 'where exists' solution. Is this an attribute of PostgreSQL in particular, or would it be true of RDBMSs in general? evaluation of subqueries is one

Re: [GENERAL] SQL - finding next date

2007-04-12 Thread Alvaro Herrera
Merlin Moncure escribió: my suggestion to return the record in a field as a composite type is a non-standard trick (i think...do composite types exist in the sql standard?). I think composite types are in the standard, yes, but they are a bit different from what we have. I tried to read that

[GENERAL] Bugs not appearing in list archives

2007-04-12 Thread Chris Fischer
I've posted a bug report twice through the web based interface, most recently last Friday. To date, my bug has never shown up in the archives for the pg-bugs list. Chris Fischer Database Engineer http://www.channeladvisor.com/ ChannelAdvisor Corporation 2701 Aerial Center Parkway Morrisville

Re: [GENERAL] seeking: advice on reordering table

2007-04-12 Thread Andrej Ricnik-Bay
On 4/12/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: can anyone suggest a good way to reorder the table ? everything that i can think of involves creating a new table which means I'd have to redo all the constraints . The common thing to do is to write your query in such a way that what

Re: [GENERAL] Bugs not appearing in list archives

2007-04-12 Thread Dave Page
Chris Fischer wrote: I've posted a bug report twice through the web based interface, most recently last Friday. To date, my bug has never shown up in the archives for the pg-bugs list. There is currently an intermittent issue with the server that forwards the bugs from the website to the

Re: [GENERAL] backend reset of database

2007-04-12 Thread Geoffrey
I've done some further research on this problem. I'm not a big user of strace, so I'm looking at getting some insight here. Basically, there are two different versions of the pcmiler libraries. One set works, the other does not. The following is the strace output from both processes. The

[GENERAL] Performance of using tablespaces to seperate indexes and tables to different disks

2007-04-12 Thread Benjamin Arai
Hi, By separating tables and indexes onto different drives through the use of tablespaces does this increase COPY or CREATE INDEX performance? If you have a ballpark figure of how much gain if any, that would be great too. Benjamin ---(end of

[GENERAL] pg_dump when database contains multiple tablespaces

2007-04-12 Thread Benjamin Arai
Hi, What is the resulting dump (pg_dump) from a database with multiple tables spaces? Does the dump just strip off the TABLESPACE command, so it will lump all the tablespaces into the default tablespace? Benjamin ---(end of broadcast)--- TIP

[GENERAL] local selectivity estimation - computing frequency of predicates

2007-04-12 Thread Avdhoot Kishore Saple
Dear All. How to compute the frequency of predicate (e.g. Salary $7) in an SQL query from a DB's pre-defined indexes?. I'm specifically looking at how to retrieve information about indices (like number of pages at each level of index, range of attribute values etc.) Any suggestions

[GENERAL] deadlock

2007-04-12 Thread Alexey Nalbat
Hello. I've encountered deadlock on postgresql 8.1. Here is the simple example. create table t1 ( id1 integer primary key, val1 integer ); create table t2 ( id2 integer primary key, id1 integer references t1 on delete cascade, val1 integer, val2 integer, val3 integer ); insert into t1

[GENERAL] Re: The rule question before, request official documentation on the problem

2007-04-12 Thread Patrick TJ McPhee
In article [EMAIL PROTECTED], Chris Travers [EMAIL PROTECTED] wrote: % DO ALSO rules involving NEW are fundamentally dangerous to the integrity % of data because NEW is not guaranteed to be internally consistent. DO % INSTEAD rules are fine (there is only one NEW), as are any DO ALSO rules %

[GENERAL] Start postgresql failed

2007-04-12 Thread yli
Hi, everyone. I tried restart the postgresql after my computer crashed. However, It is failed. the reason in the log file is runuser: cannot set groups: Operation not permitted IT is really strange error isnt it? Dose anybody have a clue??? Thanks very much

Re: [GENERAL] SQL - finding next date

2007-04-12 Thread Jeffrey Melloy
On 4/11/07, Raymond O'Donnell [EMAIL PROTECTED] wrote: Hi all, This is probably a very simple one, but I just can't see the answer and it's driving me nuts. I have a table holding details of academic terms, and I need an SQL query such that for any given term I want to find the next term by

Re: [GENERAL] Evaluate only one CASE WHEN in a select

2007-04-12 Thread dcrespo
On Apr 11, 11:35 pm, [EMAIL PROTECTED] (Guy Rouillier) wrote: dcrespo wrote: Hi everybody, I'm implementing something like this: SELECT CASE WHEN add_numbers(t1.main_number,t2.main_number)100 THEN t1.description1 ELSE t2.description1 END AS

Re: [GENERAL] backend reset of database

2007-04-12 Thread Geoffrey
Geoffrey wrote: I forgot to mention the one difference I did see in the strace output. I don't understand why there would be difference in the call parms to poll(). Then again, I'm not altogether sure what code is calling poll at this point. I'm assuming it's from the database engine. I've

Re: [GENERAL] backend reset of database

2007-04-12 Thread Tom Lane
Geoffrey [EMAIL PROTECTED] writes: I've done some further research on this problem. I'm not a big user of strace, so I'm looking at getting some insight here. Basically, there are two different versions of the pcmiler libraries. One set works, the other does not. The following is the

Re: [GENERAL] backend reset of database

2007-04-12 Thread Geoffrey
Tom Lane wrote: Geoffrey [EMAIL PROTECTED] writes: I've done some further research on this problem. I'm not a big user of strace, so I'm looking at getting some insight here. Basically, there are two different versions of the pcmiler libraries. One set works, the other does not. The

Re: [GENERAL] deadlock

2007-04-12 Thread Tom Lane
Alexey Nalbat [EMAIL PROTECTED] writes: I've encountered deadlock on postgresql 8.1. Here is the simple example. Your example doesn't deadlock for me ... regards, tom lane ---(end of broadcast)--- TIP 9: In versions below

Re: [GENERAL] Evaluate only one CASE WHEN in a select

2007-04-12 Thread Tom Lane
dcrespo [EMAIL PROTECTED] writes: They are exactly the same, that's why I want to evaluate it only once and, depending on it, put the corresponding value into two different fields that must be returned, instead of evaluating once for each field. Any insight? There's no solution that wouldn't

Re: [GENERAL] deadlock

2007-04-12 Thread Scott Marlowe
On Mon, 2007-04-09 at 04:24, Alexey Nalbat wrote: Hello. I've encountered deadlock on postgresql 8.1. Here is the simple example. create table t1 ( id1 integer primary key, val1 integer ); create table t2 ( id2 integer primary key, id1 integer references t1 on delete cascade,

Re: [GENERAL] pg_standby

2007-04-12 Thread Thomas F. O'Connell
On Mar 29, 2:17 pm, [EMAIL PROTECTED] (Thomas F. O'Connell) wrote: I see that Simon has pushed pg_standbyinto contrib for 8.3. Is there anything that would make the current version in CVS unsuitable for use in 8.2.x? I've done a cursory inspection of the code, but I'll admit that I haven't

Re: [GENERAL] backend reset of database

2007-04-12 Thread Geoffrey
Tom Lane wrote: Geoffrey [EMAIL PROTECTED] writes: I've done some further research on this problem. I'm not a big user of strace, so I'm looking at getting some insight here. Basically, there are two different versions of the pcmiler libraries. One set works, the other does not. The

Re: [GENERAL] seeking: advice on reordering table

2007-04-12 Thread Brent Wood
Andrej Ricnik-Bay wrote: On 4/12/07, Jonathan Vanasco [EMAIL PROTECTED] wrote: can anyone suggest a good way to reorder the table ? everything that i can think of involves creating a new table which means I'd have to redo all the constraints . The common thing to do is to write your query in

[GENERAL] DTrace and PostgreSQL

2007-04-12 Thread Karen Hill
I've got Solaris 10 11/06 on my PC. I removed the static keyword in src/backend/access/transam/xact.c. for the AbortTransaction and CommitTransaction functions declarations and compiled 8.2.3. Everything works nicely. I was wondering if DTrace could tell me how many inserts are being done in a

Re: [GENERAL] DTrace and PostgreSQL

2007-04-12 Thread Alvaro Herrera
Karen Hill wrote: I've got Solaris 10 11/06 on my PC. I removed the static keyword in src/backend/access/transam/xact.c. for the AbortTransaction and CommitTransaction functions declarations and compiled 8.2.3. Everything works nicely. I was wondering if DTrace could tell me how many

[GENERAL] Arrays with Rails?

2007-04-12 Thread Rick Schumeyer
Has anyone here used a postgres array with Rails? If so, how? ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Arrays with Rails?

2007-04-12 Thread Joshua D. Drake
Rick Schumeyer wrote: Has anyone here used a postgres array with Rails? If so, how? split()? ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings -- === The PostgreSQL Company: Command Prompt, Inc.