Re: [GENERAL] how to get the deleted data

2010-05-05 Thread Brian Modra
On 06/05/2010, AI Rumman wrote: > Unauthorized user deleted some critical data from the database. > I don't have any log. > > Is it possible to get what was the command used to delete the data? > Is your server saving WAL's? -- Brian Modra Land line: +27 23 5411 462 Mobile: +27 79 69 77 082 5

[GENERAL] how to get the deleted data

2010-05-05 Thread AI Rumman
Unauthorized user deleted some critical data from the database. I don't have any log. Is it possible to get what was the command used to delete the data?

Re: [GENERAL] Please help me debug regular segfaults on 8.3.10

2010-05-05 Thread pgsql
Tom Lane wrote: pgsql writes: Tom Lane wrote: Looking at debug_query_string in the core dumps would at least show what SQL command is calling the function(s) --- and I wouldn't be surprised if there's exactly one function involved here. Content of debug_query_string: core.21207 $1 = 6310

Re: [GENERAL] Savepoint and prepared transactions

2010-05-05 Thread Konstantin Izmailov
yep, thank you! On Wed, May 5, 2010 at 5:47 AM, Scott Marlowe wrote: > Should work. I'm not sure 2.5 release savepoint is necessary. > > On Wed, May 5, 2010 at 12:53 AM, Konstantin Izmailov > wrote: > > I expect that only changes on step 2.7 persisted in DB. > > > > On Tue, May 4, 2010 at 11:18

Re: [GENERAL] alter table alter type CASCADE

2010-05-05 Thread Peter Hunsberger
On Wed, May 5, 2010 at 7:31 AM, Thom Brown wrote: > On 5 May 2010 13:14, Chris Barnes wrote: >> >> It has been some years since I worked with Oracle, doesn't Oracle >> recompile the view when the object it references changes in structure? >> Send > > What does Oracle do when you've got a view lik

Re: [GENERAL] pg_class has 3615 rows and 1010Mb in table size

2010-05-05 Thread Alvaro Herrera
Excerpts from Joshua D. Drake's message of mié may 05 15:37:05 -0400 2010: > On Wed, 2010-05-05 at 09:40 -0700, Nikola wrote: > > > I looked at the pg_class table and noticed that its size is 1010Mb and > > index size is 1137Mb, while the table itself has only 3615 rows in it. > > I tried vacuumin

Re: [GENERAL] pg_class has 3615 rows and 1010Mb in table size

2010-05-05 Thread Nikola
On May 5, 3:37 pm, j...@commandprompt.com ("Joshua D. Drake") wrote: > On Wed, 2010-05-05 at 09:40 -0700, Nikola wrote: > > I looked at the pg_class table and noticed that its size is 1010Mb and > > index size is 1137Mb, while the table itself has only 3615 rows in it. > > I tried vacuuming it, but

Re: [GENERAL] LDAP: Auto user creation and role membership

2010-05-05 Thread Magnus Hagander
On Wed, May 5, 2010 at 22:49, Daniel Scott wrote: > Hi, > > I have Postgres 8.4.3 running with gss authentication against Fedora's > FreeIPA (Integrated Kerberos, LDAP and some other services). > > I would like to auto-create users and auto-map postgres roles with > users and groups within the Fre

[GENERAL] when to update pg_statistic relation?

2010-05-05 Thread sunpeng
when to update pg_statistic relation? is it when inserting a new tuple of any user's relations? and the relation pg_stats at document 8.4 chapter 44.55.pg_stats hasn't been used anymore ? another question is: I noticed when i send the sql :"select catcode from pois goup by catcode", the function :d

[GENERAL] LDAP: Auto user creation and role membership

2010-05-05 Thread Daniel Scott
Hi, I have Postgres 8.4.3 running with gss authentication against Fedora's FreeIPA (Integrated Kerberos, LDAP and some other services). I would like to auto-create users and auto-map postgres roles with users and groups within the FreeIPA LDAP directory. Can anyone tell me if this is available in

Re: [GENERAL] Please help me debug regular segfaults on 8.3.10

2010-05-05 Thread Tom Lane
pgsql writes: > Tom Lane wrote: >> Looking at debug_query_string in the core dumps would >> at least show what SQL command is calling the function(s) --- and I >> wouldn't be surprised if there's exactly one function involved here. > Content of debug_query_string: > core.21207 > $1 = 63106368 U

Re: [GENERAL] pg_class has 3615 rows and 1010Mb in table size

2010-05-05 Thread Joshua D. Drake
On Wed, 2010-05-05 at 09:40 -0700, Nikola wrote: > I looked at the pg_class table and noticed that its size is 1010Mb and > index size is 1137Mb, while the table itself has only 3615 rows in it. > I tried vacuuming it, but that did not change anything. Is there > anything I can do to get this tabl

Re: [GENERAL] Please help me debug regular segfaults on 8.3.10

2010-05-05 Thread pgsql
Tom Lane wrote: pgsql writes: Looking at debug_query_string in the core dumps would at least show what SQL command is calling the function(s) --- and I wouldn't be surprised if there's exactly one function involved here. Content of debug_query_string: core.21207 $1 = 63106368 core.20832 $1 =

Re: [GENERAL] Please help me debug regular segfaults on 8.3.10

2010-05-05 Thread pgsql
Alvaro Herrera wrote: pgsql wrote: Hi, one of our pgsql instances recently started to segfault multiple times a week. I tried a couple of things to pin it down to a certain query or job but failed to find any pattern. All I can offer is some notes and a set of similar looking back traces. Ple

[GENERAL] pg_class has 3615 rows and 1010Mb in table size

2010-05-05 Thread Nikola
The pgAdmin performance on one of our database servers has been dismal for a while now. I captured one of the queries that was taking forever to return, therefore making pgAdmin unresponsive for up to 10 minutes. The query is as follows: SELECT rel.oid, relname, rel.reltablespace AS spcoid, spcnam

Re: [GENERAL] question about log entry from trigger execution

2010-05-05 Thread Tom Lane
Susan Cassidy writes: > I have a database I inherited with a number of triggers defined on various > tables. > One AFTER trigger, when executed, causes a database log entry with a > "CONTEXT" entry, but no ERROR. I normally only see the CONTEXT entries when > an ERROR occurs. The CONTEXT is a

[GENERAL] question about log entry from trigger execution

2010-05-05 Thread Susan Cassidy
I have a database I inherited with a number of triggers defined on various tables. One AFTER trigger, when executed, causes a database log entry with a "CONTEXT" entry, but no ERROR. I normally only see the CONTEXT entries when an ERROR occurs. The trigger is on table rbs, and it returns NULL

Re: [GENERAL] database Benchmark, TPC, PostgreSQL and TPC-E

2010-05-05 Thread Greg Smith
williamk...@libero.it wrote: are there somewhere some results of TPC-* benchmarks for PostgreSQL? Are there reliable database tests? There are open source implementation? There are other benchmarks that would be worth to consider to use, or implement? There's a bunch of information on this

Re: [GENERAL] need help on postgres

2010-05-05 Thread Thom Brown
On 5 May 2010 08:28, raha sadeghi wrote: > hi, > i am a student , and for my final project i have to work with postgresql ; > my project subject is data warehousing & data mining, so i need to define > cube; create dimention table & fact table & ... > i had active cube in template1; i mean i ru

Re: [GENERAL] Table alias and inherited tables

2010-05-05 Thread Amol Chiplunkar
nevermind.. guess there was a problem with the query condition itself regards - Amol On 05/04/10 22:42, Amol Chiplunkar wrote: Hi, I notice that for the following: Table Base with say columns col1, col2 Table Child1 inherits(Base) Table Child2 inherits(Base) With check constraints and rule

[GENERAL] need help on postgres

2010-05-05 Thread raha sadeghi
hi, i am a student , and for my final project i have to work with postgresql ; my project subject is data warehousing & data mining, so i need to define cube; create dimention table & fact table & ... i had active cube in template1; i mean i run cube.sql and there are cube functions in my databas

[GENERAL] Table alias and inherited tables

2010-05-05 Thread Amol Chiplunkar
Hi, I notice that for the following: Table Base with say columns col1, col2 Table Child1 inherits(Base) Table Child2 inherits(Base) With check constraints and rules to insert the rows to appropriate tables defined. Inserts work as expected. select * from Base; returns rows from both the child

[GENERAL] dynamically access columns in trigger

2010-05-05 Thread Daniel Schuchardt
Hy, i need to have some idea how to dynamically access columns in a trigger. Use/Case: We have a workflowmodule. In different cases different workflows should be fired. In the Workflowdefinitiontable, we say "tablename, when". so e.g. ~~table 1 -> insert~~ ~~table 2 -> update~~. We have a ce

[GENERAL] Multilevel partitioning

2010-05-05 Thread pasman pasmański
I create partitions as below. And run query: select * from test where grupa='A'; Is planner skip to analyze partitions: test2d, test2e, test2f ? best regards - CREATE TABLE test ( grupa character varying(1), id

Re: [GENERAL] temp sequence

2010-05-05 Thread Andy Colson
On 5/5/2010 2:36 AM, Sim Zacks wrote: I am using 8.2.14 I am trying to use a temp sequence in a function and I'm having a lot of trouble. I create the temp sequence and then I have to drop it at the end of the function, because it stays alive for the whole session and not just the function. I wa

Re: [GENERAL] database Benchmark, TPC, PostgreSQL and TPC-E

2010-05-05 Thread Andy Colson
On 5/5/2010 2:56 AM, williamk...@libero.it wrote: Looking for database benchmarks I fell into the Transaction Processing Performance Council Some questions on it. are there somewhere some results of TPC-* benchmarks for PostgreSQL? Are there reliable database tests? There are open source implem

Re: [GENERAL] temp sequence

2010-05-05 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > I am trying to use a temp sequence in a function and I'm having a lot of > trouble. > I create the temp sequence and then I have to drop it at the end of the > function, because it stays alive for the whole session and not just the > functio

Re: [GENERAL] temp sequence

2010-05-05 Thread Scott Marlowe
2010/5/5 Sim Zacks : > I am using 8.2.14 > > I am trying to use a temp sequence in a function and I'm having a lot of > trouble. > I create the temp sequence and then I have to drop it at the end of the > function, because it stays alive for the whole session and not just the > function. > I want t

Re: [GENERAL] alter table alter type CASCADE

2010-05-05 Thread Scott Marlowe
2010/5/5 Sim Zacks : > One of the biggest problems I have maintaining a database with a lot of > views is that when I want to change a datatype, I have to drop every > view uses the column and every view that uses those views etc... > This turns into a maintenance nightmare. Then I would question

Re: [GENERAL] Savepoint and prepared transactions

2010-05-05 Thread Scott Marlowe
Should work. I'm not sure 2.5 release savepoint is necessary. On Wed, May 5, 2010 at 12:53 AM, Konstantin Izmailov wrote: > I expect that only changes on step 2.7 persisted in DB. > > On Tue, May 4, 2010 at 11:18 PM, Scott Marlowe > wrote: >> >> On Tue, May 4, 2010 at 11:52 PM, Konstantin Izmai

Re: [GENERAL] alter table alter type CASCADE

2010-05-05 Thread Thom Brown
On 5 May 2010 13:14, Chris Barnes wrote: > > It has been some years since I worked with Oracle, doesn't Oracle recompile > the view when the object it references changes in structure? > Send > What does Oracle do when you've got a view like: CREATE OR REPLACE VIEW test_view AS SELECT test.test

Re: [GENERAL] alter table alter type CASCADE

2010-05-05 Thread Chris Barnes
It has been some years since I worked with Oracle, doesn't Oracle recompile the view when the object it references changes in structure? Send From: thombr...@gmail.com Date: Wed, 5 May 2010 10:12:34 +0100 Subject: Re: [GENERAL] alter table alter type CASCADE To: s...@compulab.co.il CC: p

Re: [GENERAL] (psuedo) random serial for PK or at least UNIQUE NOT NULL?

2010-05-05 Thread Cédric Villemain
2010/5/5 Vincenzo Romano : >>> http://wiki.postgresql.org/wiki/Pseudo_encrypt >>> That's a nice starting point. >>> I should apply that function twice for each 32-bit chunk of a >>> 64-bit BIGINT and then merge the results into a single BIGINT ... >>> Boring but doable! >> >> Hum, not sure. If

Re: [GENERAL] (psuedo) random serial for PK or at least UNIQUE NOT NULL?

2010-05-05 Thread Vincenzo Romano
>> http://wiki.postgresql.org/wiki/Pseudo_encrypt >> That's a nice starting point. >> I should apply that function twice for each 32-bit chunk of a >> 64-bit BIGINT and then merge the results into a single BIGINT ... >> Boring but doable! > > Hum, not sure. If I understand correctly, you won't

Re: [GENERAL] (psuedo) random serial for PK or at least UNIQUE NOT NULL?

2010-05-05 Thread Cédric Villemain
2010/5/5 Vincenzo Romano : > 2010/5/4 Alvaro Herrera : >> Vincenzo Romano wrote: >>> Hi all. >>> >>> I'm willing to change an BIGINT ID column (actually a SERIAL8) with a >>> BIGINT whose valules are (pseudo)random. >>> The main objective is to avoid guessability. >>> I whish I could also use it as

Re: [GENERAL] alter table alter type CASCADE

2010-05-05 Thread Thom Brown
2010/5/5 Sim Zacks > One of the biggest problems I have maintaining a database with a lot of > views is that when I want to change a datatype, I have to drop every > view uses the column and every view that uses those views etc... > This turns into a maintenance nightmare. > > Is there any intent

[GENERAL] alter table alter type CASCADE

2010-05-05 Thread Sim Zacks
One of the biggest problems I have maintaining a database with a lot of views is that when I want to change a datatype, I have to drop every view uses the column and every view that uses those views etc... This turns into a maintenance nightmare. Is there any intention of adding a CASCADE to alter

Re: [GENERAL] Function not RAISE NOTICE if a parameter is NULL

2010-05-05 Thread Andre Lopes
Oh... Thanks. What a lame I'm. Best Regards, On Wed, May 5, 2010 at 1:25 AM, Tom Lane wrote: > Andre Lopes writes: > > Thanks for the reply. I have not call it STRICT... > > Yes you are: > > > RETURNS NULL ON NULL INPUT > > regards, tom lane >

[GENERAL] database Benchmark, TPC, PostgreSQL and TPC-E

2010-05-05 Thread williamk...@libero.it
Looking for database benchmarks I fell into the Transaction Processing Performance Council Some questions on it. are there somewhere some results of TPC-* benchmarks for PostgreSQL? Are there reliable database tests? There are open source implementation? There are other benchmarks that would be

[GENERAL] temp sequence

2010-05-05 Thread Sim Zacks
I am using 8.2.14 I am trying to use a temp sequence in a function and I'm having a lot of trouble. I create the temp sequence and then I have to drop it at the end of the function, because it stays alive for the whole session and not just the function. I want to use the nextval function in an upd

Re: [GENERAL] (psuedo) random serial for PK or at least UNIQUE NOT NULL?

2010-05-05 Thread Vincenzo Romano
2010/5/4 Alvaro Herrera : > Vincenzo Romano wrote: >> Hi all. >> >> I'm willing to change an BIGINT ID column (actually a SERIAL8) with a >> BIGINT whose valules are (pseudo)random. >> The main objective is to avoid guessability. >> I whish I could also use it as the PK (as it's now) but that's not