Re: Fwd: [SQL] Start up question about triggers

2006-06-27 Thread Forums @ Existanze
 
Hello again,


I looked into slony, I have a question though, how would I go about
controlling slony via a jdbc driver? See this whole problem has arisen
because for some reason my client wants to keep to separate databases in two
separate locations with the same data. So he would call this partiall backup
function via a GUI client we provide, and with this information he would go
to the same GUI client in this other location and import this partiall
backup. 

Best Regards,
Fotis

PS- Hacking pgtool is way out my leage :-) But thanks for the suggestion!!!


> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Sullivan
> Sent: 26 June 2006 17:43
> To: pgsql-sql@postgresql.org
> Subject: Re: Fwd: [SQL] Start up question about triggers
> 
> On Mon, Jun 26, 2006 at 04:59:26PM +0300, Forums @ Existanze wrote:
> > Hello again,
> > 
> > The problem is not tracking WHAT changed, this can be done, 
> as we have 
> > discussed in this thread, the problem is how to replicate the 
> > necessary commands that will alter a mirror database to 
> reflect what 
> > has been changed, sequencially and in the order that it has 
> occurred.
> > 
> > I you can find my first question (I can repost), you will see that 
> > this problem has arisen due of lack of proper design. This is a 
> > requirement that has just come into the picture and we have 
> to find a solution for it.
> 
> Ah.  That was not, in fact, clear to me.  What is it about 
> Slony that doesn't solve this problem?  You've checked it out, right? 
>  will get you there.
> 
> A
> 
> 
> --
> Andrew Sullivan  | [EMAIL PROTECTED]
> If they don't do anything, we don't need their acronym.
>   --Josh Hamilton, on the US FEMA
> 
> ---(end of 
> broadcast)---
> TIP 3: Have you checked our extensive FAQ?
> 
>http://www.postgresql.org/docs/faq
> 


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


Re: Fwd: [SQL] Start up question about triggers

2006-06-27 Thread Andrew Sullivan
On Tue, Jun 27, 2006 at 11:16:17AM +0300, Forums @ Existanze wrote:
> 
> I looked into slony, I have a question though, how would I go about
> controlling slony via a jdbc driver? See this whole problem has arisen
> because for some reason my client wants to keep to separate databases in two
> separate locations with the same data. So he would call this partiall backup
> function via a GUI client we provide, and with this information he would go
> to the same GUI client in this other location and import this partiall
> backup. 

It is totally normal to want to keep two databases in two locations:
that's a matter of safety.  Slony does it automatically, as long as
the daemon is running.  No need to control it.

_Unless_ you want to be able to write in the second database.  That's
a different problem.  You can't do that with Slony.

A

-- 
Andrew Sullivan  | [EMAIL PROTECTED]
The fact that technology doesn't work is no bar to success in the marketplace.
--Philip Greenspun

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: Fwd: [SQL] Start up question about triggers

2006-06-27 Thread Forums @ Existanze
Hello again andrew,

Actually man I do need to be able to write to both databases, and keep them
synchronized, and all this because of the recurring xenofobia for technology
and the fear of "hackers" (I know the difference between hackers and
crackers) on the internet, I actually said, it will cost less to have an
adsl line on both location connecting to the same database than to pay me to
create the synchronization framework, but hey what can you do!


Best Regards,
Fotis
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Sullivan
> Sent: 27 June 2006 14:40
> To: pgsql-sql@postgresql.org
> Subject: Re: Fwd: [SQL] Start up question about triggers
> 
> On Tue, Jun 27, 2006 at 11:16:17AM +0300, Forums @ Existanze wrote:
> > 
> > I looked into slony, I have a question though, how would I go about 
> > controlling slony via a jdbc driver? See this whole problem 
> has arisen 
> > because for some reason my client wants to keep to separate 
> databases 
> > in two separate locations with the same data. So he would call this 
> > partiall backup function via a GUI client we provide, and with this 
> > information he would go to the same GUI client in this 
> other location 
> > and import this partiall backup.
> 
> It is totally normal to want to keep two databases in two locations:
> that's a matter of safety.  Slony does it automatically, as 
> long as the daemon is running.  No need to control it.
> 
> _Unless_ you want to be able to write in the second database. 
>  That's a different problem.  You can't do that with Slony.
> 
> A
> 
> --
> Andrew Sullivan  | [EMAIL PROTECTED]
> The fact that technology doesn't work is no bar to success in 
> the marketplace.
>   --Philip Greenspun
> 
> ---(end of 
> broadcast)---
> TIP 4: Have you searched our list archives?
> 
>http://archives.postgresql.org
> 


---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: Fwd: [SQL] Start up question about triggers

2006-06-27 Thread Joe

Andrew Sullivan wrote:

On Tue, Jun 27, 2006 at 11:16:17AM +0300, Forums @ Existanze wrote:

I looked into slony, I have a question though, how would I go about
controlling slony via a jdbc driver? See this whole problem has arisen
because for some reason my client wants to keep to separate databases in two
separate locations with the same data. So he would call this partiall backup
function via a GUI client we provide, and with this information he would go
to the same GUI client in this other location and import this partiall
backup. 


It is totally normal to want to keep two databases in two locations:
that's a matter of safety.  Slony does it automatically, as long as
the daemon is running.  No need to control it.


But with file-based log shipping (see 
http://linuxfinances.info/info/logshipping.html) one could write a Java 
app to control when the updates are applied.


Joe

---(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


[SQL] Joins between int and int[]

2006-06-27 Thread Rodrigo Sakai








  Hi,

 

  I want to use the system catalog tables/views
to query some things, and one of the queries I have to do is joining
pg_attribute and pg_constraint to know what constraint belongs to which
table.attribute. My question is how can I write the join clause between a int (pg_attribute.attnum)
and int[ ] (pg_constraint.conkey).

 

 

The query is:

 

select relname, attname, attnotnull, atthasdef

  from pg_class as pc 

  inner join pg_attribute as pa

    on pc.oid=pa.attrelid

  inner join pg_constraint pcons

 on pc.oid=pcons.conrelid

    and pa.attnum = pcons.conkey 
-à
the problem

 

 



 Thanks!!! 



 








[SQL] Schema management tool

2006-06-27 Thread Kyle Bateman




I just saw this very old post and thought I'd respond for the benefit
of the list:

Patrick,

> Could someone give me some advice or point me to an article that would help
> manage views?  I have a view that I use in conjunction with other views,
> and since I have to drop the view and then recreate it, I'm force to drop
> and recreate all other views that the original view was used in.
> TIA

As I recall, the IT staff at Action Target, Inc. two years ago developed a 
non-free tool for this purpose.   They were planning to start a spin-off 
company to market PostgreSQL admin tools, but I don't know how far they got 
with the idea.   

Try contacting Action Target's webmaster to see if you can find anything out:
webmaster ( at ) actiontarget ( dot ) com


We have a free (GPL) tool called "wyseman" that is a framework for
authoring schemas in postgres.  You create a meta-sql structure for
each database object you want in the database.  Then you call wyseman
to drop and/or re-create the object, along with all its dependencies.

This is a great tool for working on a live database.  You can maintain
a pristine, authoritative definition of your schema, and still migrate
your live database along as you make changes to the design.  When you
want to modify a section of the schema that is deep within the tree of
dependencies, wyseman will take care of dropping, rebuilding, and
granting permissions on all the necessary objects in order to get into
the part you want to change.

Wyseman also takes care of building a "data dictionary" where you can
query for things like printable titles, and pop-up helps for tables and
columns in multiple languages.  This is a nice layer to put on top of
postgres and just under your ERP.

These tools are accessible on wyatterp.com.  Due to lack of time, I
have not kept current software in the download area.  We are using much
later stuff in-house.  But I would be happy to share more recent
versions if there is any interest out there.  It would be particularly
helpful if anyone were willing to help maintain the website and
(currently a sad excuse for) documentation.

There is also a run-time library (wylib) for rapid construction of ERP
applications.  We have about 30 applications built in the framework
that run our entire business.

Kyle Bateman
Action Target Inc.





Re: [SQL] Schema management tool

2006-06-27 Thread Josh Berkus

Kyle,

Nice to hear from you guys again!  Action Target was one of the pioneers 
of production open source in manufacturing; nice to know that you're 
still doing well with it.


--Josh

---(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: Fwd: [SQL] Start up question about triggers

2006-06-27 Thread Andrew Sullivan
On Tue, Jun 27, 2006 at 02:48:38PM +0300, Forums @ Existanze wrote:
> Hello again andrew,
> 
> Actually man I do need to be able to write to both databases, and keep them
> synchronized, and all this because of the recurring xenofobia for technology

Then sorry, but this can't be done out of the box by anything.  You
have all manner of race conditions here. 

> and the fear of "hackers" (I know the difference between hackers and

Moreover, this won't solve their problem: if someone compromised the
application, both databases would be corrupted.  There's no way to
avoid that in such a design.

Better to use Slony in log-shipping mode (or PITR) and keep backups
of all the change sets.  Then if someone broke in, you'd at least be
able to roll back to the known-good state.

A

-- 
Andrew Sullivan  | [EMAIL PROTECTED]
The fact that technology doesn't work is no bar to success in the marketplace.
--Philip Greenspun

---(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: Fwd: [SQL] Start up question about triggers

2006-06-27 Thread Andrew Sullivan
On Tue, Jun 27, 2006 at 08:14:34AM -0400, Joe wrote:
> 
> But with file-based log shipping (see 
> http://linuxfinances.info/info/logshipping.html) one could write a Java 
> app to control when the updates are applied.

Well, sure.  I mean, if you decide first, "I'll use Java," and then
start asking what problems you can solve, you can do anything ;-)  I
prefer the strategy whereby one asks what the problem is to be solved
first, then choose the technology.

A

-- 
Andrew Sullivan  | [EMAIL PROTECTED]
I remember when computers were frustrating because they *did* exactly what 
you told them to.  That actually seems sort of quaint now.
--J.D. Baldwin

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


Re: Fwd: [SQL] Start up question about triggers

2006-06-27 Thread Richard Broersma Jr
> > Actually man I do need to be able to write to both databases, and keep them
> > synchronized, and all this because of the recurring xenofobia for technology
> 
> Then sorry, but this can't be done out of the box by anything.  You
> have all manner of race conditions here. 

Doesn't PGcluster allow for multiple master databases that are kept 
synchronized?
http://pgfoundry.org/projects/pgcluster/

I thought that Mammoth replicator might support synchronous masters but it 
appears to be an
Asynchronous system like Slony.
http://www.commandprompt.com/products/mammothreplicator

Regards,

Richard Broersma Jr.

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


Re: Fwd: [SQL] Start up question about triggers

2006-06-27 Thread Alvaro Herrera
Richard Broersma Jr wrote:

> I thought that Mammoth replicator might support synchronous masters
> but it appears to be an Asynchronous system like Slony.
> http://www.commandprompt.com/products/mammothreplicator

You are right, Mammoth Replicator is asynchronous single master, just
like Slony.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(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


[SQL] i need solution to this problem

2006-06-27 Thread Penchalaiah P.








Hi good morning to all……..

 

I have tables like 1) emp_table (personal_no integer (foreign
key), cdacno varchar (primary key),name varchar);

    

2) Rank_table (rank_id
varchar (primary key), rank_name varchar);

 

3) Rank_date_table
(rank_id (foreign key), rank_date date);

 

4) Unit_table (unit_id
varchar (primarykey), unit_name varchar);

 

5) Personal_table (per_no
varchar (primary key), pername varchar);

 

My query is ….if I give cdacno I have to get per_no
from personal_table.. With this I have to display rank_name from rank_table ,name
from emp_table, unit_name from unit_master..

 

Like that if I give per_no I have to get cdacno from emp_table..
.. With this I have to display rank_name from rank_table ,name from emp_table,
unit_name from unit_master..

 

Doing these things first it has to check when we r giving cdacno..
whether  per_no is null or not.. like this if I give per_no it has to
check cdacno is null or not.

 

Let me know the solution..

But I written one function to this to get per_no if I give
cdacno……….

 

 

Thanks  &  Regards

Penchal reddy | Software Engineer
  

Infinite Computer Solutions | Exciting Times…Infinite Possibilities... 

SEI-CMMI level 5 | ISO 9001:2000

IT SERVICES |
BPO  


Telecom | Finance
| Healthcare | Manufacturing
| Energy & Utilities | Retail
& Distribution | Government   


Tel +91-80-5193-(Ext:503)| Fax  +91-80-51930009 | Cell No  +91-9980012376|www.infics.com  

Information transmitted by this e-mail is
proprietary to Infinite Computer Solutions and/ or its Customers and is
intended for use only by the individual or entity to which it is addressed, and
may contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you are not the intended recipient or it
appears that this mail has been forwarded to you without proper authority, you
are notified that any use or dissemination of this information in any manner is
strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this mail from your records.

 







Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and / or its Customers and is intended for use only by the individual or the entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at [EMAIL PROTECTED] and delete this email from your records.