Re: [HACKERS] Temparary disable constraint

2007-01-18 Thread Adnan DURSUN


   Maybe you are right as technically but this behaver causes a lot 
of maintance problem on a database that alot of view and functions that 
depends on a table or a type. I think objects has a property if that object 
is enable or not. We hope this problem can be resolved at 8.4 release.


Best Regards

Adnan DURSUN
ASRIN Bilisim Ltd.

- Original Message - 
From: Bruce Momjian [EMAIL PROTECTED]

To: Adnan DURSUN [EMAIL PROTECTED]
Cc: pgsql-hackers@postgresql.org
Sent: Wednesday, January 17, 2007 5:49 PM
Subject: Re: [HACKERS] Temparary disable constraint



Adnan DURSUN wrote:

   Hi, Maybe added more further things to TODO list. Enabled /
   disabled other objects like view/funtion. imagine a lot of
   views that referances a table and i wanna drop a column on this
   table that used by these views. Postgres doesnt allow this.
   First i must drop these views then drop the column on that
   table and then recreate these views.  Can this be resolved
   (like oracle does) ?


Not easily, because the view are bound to the object id of the tables
involved.

--
 Bruce Momjian   [EMAIL PROTECTED]
 EnterpriseDBhttp://www.enterprisedb.com

 + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings




---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] Temparary disable constraint

2007-01-18 Thread Richard Huxton

Bruce Momjian wrote:

Adnan DURSUN wrote:

   Hi, Maybe added more further things to TODO list. Enabled /
   disabled other objects like view/funtion. imagine a lot of
   views that referances a table and i wanna drop a column on this
   table that used by these views. Postgres doesnt allow this.
   First i must drop these views then drop the column on that
   table and then recreate these views.  Can this be resolved
   (like oracle does) ?


Not easily, because the view are bound to the object id of the tables
involved.


The trick would be I think to bind them to individual columns, so if 
view V doesn't mention column C then dropping C has no effect on it.


That's a lot more dependencies to track of course.

--
  Richard Huxton
  Archonet Ltd

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Temparary disable constraint

2007-01-18 Thread Adnan DURSUN
- Original Message - 
From: Richard Huxton dev@archonet.com

To: Bruce Momjian [EMAIL PROTECTED]
Cc: Adnan DURSUN [EMAIL PROTECTED]; pgsql-hackers@postgresql.org
Sent: Thursday, January 18, 2007 5:57 PM
Subject: Re: [HACKERS] Temparary disable constraint



Not easily, because the view are bound to the object id of the tables
involved.


The trick would be I think to bind them to individual columns, so if view 
V doesn't mention column C then dropping C has no effect on it.


That's a lot more dependencies to track of course.

  Is that not possible that all objects have a column that says whether 
object state is ok or not.
When any session wants to try to execute any DML on object, then the 
Postgres checks that state column.

If object state is not ok then Postgres raises an exception.

Best Regards

Adnan DURSUN
ASRIN Bilisim Ltd. 



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] Temparary disable constraint

2007-01-17 Thread Hubert FONGARNAND
Ok it works, but we have to write a plpgsql function that takes the
table_name and the constraint name in parameters

It could be useful to have a : ALTER TABLE ... DISABLE CONSTRAINT ...
(as oracle does)

it could be good to add this to the TODO LIST...

Thanks



Le mardi 16 janvier 2007 à 22:02 -0500, Bruce Momjian a écrit : 

 Hubert FONGARNAND wrote:
  Hi,
  
  Is there a way to temporary disable a constraint (without drop and
  recreating it) in postgresql?
 
 Sure, try ALTER TABLE ... DISABLE TRIGGER for the constraint trigger
 name.
 
___
Ce message et les �ventuels documents joints peuvent contenir des informations 
confidentielles.
Au cas o� il ne vous serait pas destin�, nous vous remercions de bien vouloir 
le supprimer et en aviser imm�diatement l'exp�diteur. Toute utilisation de ce 
message non conforme � sa destination, toute diffusion ou publication, totale 
ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'�tant pas s�curis�es, l'int�grit� de ce 
message n'est pas assur�e et la soci�t� �mettrice ne peut �tre tenue pour 
responsable de son contenu.


Re: [HACKERS] Temparary disable constraint

2007-01-17 Thread Adnan DURSUN
Hi,
Maybe added more further things to TODO list. Enabled / disabled other 
objects like view/funtion. imagine a lot of views that referances a table and i 
wanna drop a column on this table that used by these views. Postgres doesnt 
allow this. First i must drop these views then drop the column on that table 
and then recreate these views. 
Can this be resolved (like oracle does) ?

Best regards

Adnan DURSUN
ASRIN Bilişim Ltd.
  - Original Message - 
  From: Hubert FONGARNAND 
  To: Bruce Momjian 
  Cc: pgsql-hackers@postgresql.org 
  Sent: Wednesday, January 17, 2007 10:36 AM
  Subject: Re: [HACKERS] Temparary disable constraint


  Ok it works, but we have to write a plpgsql function that takes the 
table_name and the constraint name in parameters

  It could be useful to have a : ALTER TABLE ... DISABLE CONSTRAINT ...
  (as oracle does)

  it could be good to add this to the TODO LIST...

  Thanks



  Le mardi 16 janvier 2007 à 22:02 -0500, Bruce Momjian a écrit : 
Hubert FONGARNAND wrote:
 Hi,
 
 Is there a way to temporary disable a constraint (without drop and
 recreating it) in postgresql?

Sure, try ALTER TABLE ... DISABLE TRIGGER for the constraint trigger
name.

___
  Ce message et les 鶥ntuels documents joints peuvent contenir des informations 
confidentielles.
  Au cas o?ne vous serait pas destin鬠nous vous remercions de bien vouloir le 
supprimer et en aviser imm餩atement l'exp餩teur. Toute utilisation de ce message 
non conforme ࠳a destination, toute diffusion ou publication, totale ou 
partielle et quel qu'en soit le moyen est formellement interdite.
  Les communications sur internet n'鴡nt pas s飵ris饳, l'int駲it頤e ce message n'est 
pas assur饠et la soci鴩 魥ttrice ne peut 괲e tenue pour responsable de son contenu. 

Re: [HACKERS] Temparary disable constraint

2007-01-17 Thread Bruce Momjian
Hubert FONGARNAND wrote:
 Ok it works, but we have to write a plpgsql function that takes the
 table_name and the constraint name in parameters
 
 It could be useful to have a : ALTER TABLE ... DISABLE CONSTRAINT ...
 (as oracle does)
 
 it could be good to add this to the TODO LIST...

Well, we currently only allow disabling foreign key constraints (those
that have triggers).  There is no way to disable a UNIQUE or NOT NULL
constraint, for example, so I don't see how we can do DISABLE CONSTRAINT
cleanly.

---


 
 Thanks
 
 
 
 Le mardi 16 janvier 2007 ? 22:02 -0500, Bruce Momjian a ?crit : 
 
  Hubert FONGARNAND wrote:
   Hi,
   
   Is there a way to temporary disable a constraint (without drop and
   recreating it) in postgresql?
  
  Sure, try ALTER TABLE ... DISABLE TRIGGER for the constraint trigger
  name.
  
 ___
 Ce message et les ?entuels documents joints peuvent contenir des informations 
 confidentielles.
 Au cas o?il ne vous serait pas destin? nous vous remercions de bien vouloir 
 le supprimer et en aviser imm?iatement l'exp?iteur. Toute utilisation de ce 
 message non conforme ?sa destination, toute diffusion ou publication, totale 
 ou partielle et quel qu'en soit le moyen est formellement interdite.
 Les communications sur internet n'?ant pas s?uris?s, l'int?rit?de ce message 
 n'est pas assur? et la soci???ettrice ne peut ?re tenue pour responsable de 
 son contenu.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Temparary disable constraint

2007-01-17 Thread Bruce Momjian
Adnan DURSUN wrote:
Hi, Maybe added more further things to TODO list. Enabled /
disabled other objects like view/funtion. imagine a lot of
views that referances a table and i wanna drop a column on this
table that used by these views. Postgres doesnt allow this.
First i must drop these views then drop the column on that
table and then recreate these views.  Can this be resolved
(like oracle does) ?

Not easily, because the view are bound to the object id of the tables
involved.

--
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[HACKERS] Temparary disable constraint

2007-01-16 Thread Hubert FONGARNAND
Hi,

Is there a way to temporary disable a constraint (without drop and
recreating it) in postgresql?

Thanks
___
Ce message et les éventuels documents joints peuvent contenir des informations 
confidentielles.
Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir 
le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce 
message non conforme à sa destination, toute diffusion ou publication, totale 
ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'étant pas sécurisées, l'intégrité de ce 
message n'est pas assurée et la société émettrice ne peut être tenue pour 
responsable de son contenu.


Re: [HACKERS] Temparary disable constraint

2007-01-16 Thread Bruce Momjian
Hubert FONGARNAND wrote:
 Hi,
 
 Is there a way to temporary disable a constraint (without drop and
 recreating it) in postgresql?

Sure, try ALTER TABLE ... DISABLE TRIGGER for the constraint trigger
name.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq