[GENERAL] Deadlock in Postgres 8.2

2008-01-20 Thread Sebastjan Trepca
Hi, we are spotting constant deadlocks when altering tables. After I restart the db the ALTER TABLE command runs without problems, but when I try to alter some other table later on it deadlocks again. If I kill the process that handles ALTER TABLE the deadlock is "unlocked", but ALTER TABLE still

Re: [GENERAL] Inheritance problem when restoring db

2007-10-29 Thread Sebastjan Trepca
Great, super thanks! Sebastjan On 10/29/07, Tom Lane <[EMAIL PROTECTED]> wrote: > I wrote: > > "Sebastjan Trepca" <[EMAIL PROTECTED]> writes: > >> This is how to reproduce this issue: > >> ... > >> inh_test=# alter table capitals inherit

Re: [GENERAL] Inheritance problem when restoring db

2007-10-28 Thread Sebastjan Trepca
its: cities inh_test=# Capitals loses its own sequence in the second case. Regards, Sebastjan On 10/1/07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Sebastjan Trepca" <[EMAIL PROTECTED]> writes: > > Current state: > > > Table B has a primary key with sequence b_s

[GENERAL] Inheritance problem when restoring db

2007-10-01 Thread Sebastjan Trepca
Hi, I noticed a small bug/problem when restoring a database that uses inheritance. Lets say you have a table B that inherits from table A. Current state: Table B has a primary key with sequence b_seq. Table A also has a primary key with sequence a_seq. Now we create a backup and restore the da

[GENERAL] Inheritance and shared sequence

2007-06-07 Thread Sebastjan Trepca
Hi, as I understood, when you create a table which inherits some other table, the constraints and indexes do not go to the child table hence you have to create a separate ones in there. That means you cannot depend that you won't have duplicate IDs in both tables. Right? BUT...what if child tabl

Re: [GENERAL] Time complexity of statements

2006-02-14 Thread Sebastjan Trepca
Ok, thanks. I guess that was a stupid question, sorry :) I guess we'll have to use INSERTs instead of UPDATEs. Sebastjan On 2/14/06, Peter Eisentraut <[EMAIL PROTECTED]> wrote: > Am Dienstag, 14. Februar 2006 16:13 schrieb Sebastjan Trepca: > > As I understood from

[GENERAL] Time complexity of statements

2006-02-14 Thread Sebastjan Trepca
Hi everybody! As I understood from books and docs every statement in Postgres takes O(1) because of it's versioning system, right? I'm talking about INSERT,UPDATE,SELECT and DELETE statement. Is it true? or did I get it wrong. I'm specially interested in UPDATE statement. We'll have lots of the

Re: [GENERAL] How to fetch rows with multiple values

2006-01-20 Thread Sebastjan Trepca
No, because I need AND operator between the terms. Thanks anyway :)SebastjanOn 1/20/06, Keary Suska < [EMAIL PROTECTED]> wrote:on 1/20/06 6:19 AM, [EMAIL PROTECTED] purportedly said:> I have a table like this:>> CREATE TABLE customer_mapping> (> "Name" varchar(128) NOT NULL,> "ID" int8 NOT NULL >

Re: [GENERAL] How to fetch rows with multiple values

2006-01-20 Thread Sebastjan Trepca
AIL PROTECTED]> wrote: On Jan 20, 2006, at 22:19 , Sebastjan Trepca wrote:> What I would like is to write a query where I can specify multiple> names and get the IDs which have them.>> For now it seems the most efficient way is to use INTERSECT statement: >> SELECT "ID"

[GENERAL] How to fetch rows with multiple values

2006-01-20 Thread Sebastjan Trepca
Hi,I have a table like this:CREATE TABLE customer_mapping(  "Name" varchar(128) NOT NULL,  "ID" int8 NOT NULL) Data looks something like this:"john" 1 "peter"    1"test"  2"george"  3What I would like is to write a query where I can specify multiple names and get the IDs which have them.For

Re: [GENERAL] Indexes works only on miss

2006-01-06 Thread Sebastjan Trepca
sed index scan too. I gues I didn't understand how indexes work.Thanks for help, Sebastjan On 1/6/06, Michael Fuhr <[EMAIL PROTECTED]> wrote: On Fri, Jan 06, 2006 at 05:42:41PM +0100, Sebastjan Trepca wrote:> I really don't understand this behaviour. I have a table with column &q

[GENERAL] Indexes works only on miss

2006-01-06 Thread Sebastjan Trepca
Hi,I really don't understand this behaviour. I have a table with column "owner" on which I created an index with btree method. The table contains around 3k rows.Now I run it using EXPLAIN command. This query has some results:explain SELECT "Name" FROM test WHERE "Owner"='root'"Seq Scan on test  (co

[GENERAL] "Could not open relation with OID x" while deleting a row

2006-01-06 Thread Sebastjan Trepca
Hi,postgres just started to report this error yesterday when I ran a user function which deletes rows in a lot of tables.I get an error:"Could not open relation with OID 18789"The function looks like this: CREATE OR REPLACE FUNCTION delete_photo(int8)  RETURNS bool AS$BODY$DECLAREgid RECORD;photo R