473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

pg_dump and circular dependency

Table A has a CHECK constraint testing boolean function F.
Function F has a SELECT from Table A.

In my manual build script, I create the table, then the function, and then at the very end of the script to I do an ALTER TABLE ADD CHECK.

pg_dump appears to put the CHECK constraint as a clause in the CREATE TABLE statement. Now I'm in trouble, because whichever of the table or the function is read in first by pg_restore refers to an object that hasn't been created yet. The restore fails.

I suppose I can replace the CHECK with an explicit trigger (that uses an exception) and then pg_dump will get the creation sequence correct. Is there another way?

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

Nov 22 '05 #1
1 2117
an****@pillette.com writes:
Table A has a CHECK constraint testing boolean function F.
Function F has a SELECT from Table A. In my manual build script, I create the table, then the function, and then at the very end of the script to I do an ALTER TABLE ADD CHECK. I suppose I can replace the CHECK with an explicit trigger (that uses an exception) and then pg_dump will get the creation sequence correct. Is there another way?


In 7.4 you could create the function first using SET
check_function_bodies = false. 7.5 will have a proper solution...
pg_dump can now actually detect reference circularities and fix them
by using ALTER ...

regards, tom lane

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

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Evelyne | last post by:
On a server W2K, IIS5, I have many messages from ASP : cirdular dependency between types/modules. Which can be the origin of the problem? Example : Event Type: Warning Event Source: Active...
2
by: ernesto basc?n pantoja | last post by:
Hi everybody: I'm implementing a general C++ framework and I have a basic question about circular dependencies: I am creating a base class Object, my Object class has a method defined as:...
4
by: ro86 | last post by:
Hello everyone! I am a newbie to C++ (~1 Week experience) and I have a few months of experience with object-oriented languages (Objective-C). I am currently working just for fun on a particle...
4
by: Henke | last post by:
I have this scenario. public class A { public int numbers; public class A() { }
2
by: Rimma Meital via .NET 247 | last post by:
(Type your message here) -------------------------------- From: Rimma Meital I have 2 DLLs (Class Libraries). Both defines single-ton objects - logger object (writes to logger) and...
4
by: jack turer | last post by:
I have a database in pgsql (7.3.2) on redhat 9. When I try a 'pg_dump mydb' to back up the database, I get: pg_dump: could not find namespace with OID 2200 Verbose version is: -bash-2.05b$...
3
by: Rob Clark | last post by:
Hi, I have an issue which is the ordinary and always recurring circular dependency - but I do not know how to resolve it :-( The usual forward declaration does not help... I have a client...
7
by: barias | last post by:
Although circular dependencies are something developers should normally avoid, unfortunately they are very easy to create accidentally between classes in a VS project (i.e. circular compile-time...
3
by: donnyma | last post by:
I have a problem that looks like it has not been discussed before in these groups. I have a simple SQLAgent job that runs sp_who (could be anything, but let's just say sp_who for this example). ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.