Re: [SQL] Unrecognized node type
Alvaro Sanchez-Mariscal <[EMAIL PROTECTED]> writes: >> I suppose there's some other factor involved in the problem that >> you didn't show us. > But... what? :-S If I knew, I could've reproduced the problem ... >> As far as finding the bug, you need to provide a complete, >> self-contained test case. > Can you be more explicit? Preferably, send an SQL script that will trigger the failure starting from an empty database. You can probably make one by stripping down your existing dump script. (I don't care whether you try to minimize the size of the example; but you'll want to take out your actual data as well as anything else you deem private.) >> As far as loading the schema, how about just removing the DEFAULT >> clauses? "default null" is the default behavior anyway. > I tried this, but then EJB's doesn't work... This is odd. I suspect that it would be appropriate to ask the JDBC people to see if they can fix it. The driver itself ought to be aware that "no default" is the same as "default null", but apparently it is not. (For that matter, whatever part of the EJB code is breaking ought to know that, because for sure it is SQL-standard behavior. But the JDBC people might be more responsive to a bug report.) regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[SQL] Queries across multiple database
I am in the process of migrating the databases for an application from mysql to postgres. The application is uses several different databases. From what I have read, postgres still does not support queries across multiple databases. If this is still true, does anyone have any tricks to get around this? I'm sure this is a common problem for people migrating from mysql. The obvious answer is to just migrate everything into one larger postgres database, but I would like to avoid this if possible - many a line of could would need to be touched if this was done. Thanks, Garth ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [SQL] Queries across multiple database
On Wed, 2004-06-30 at 18:54, Garth Thompson wrote: > I am in the process of migrating the databases for an application from mysql > to postgres. The application is uses several different databases. From > what I have read, postgres still does not support queries across multiple > databases. If this is still true, does anyone have any tricks to get around > this? I'm sure this is a common problem for people migrating from mysql. > The obvious answer is to just migrate everything into one larger postgres > database, but I would like to avoid this if possible - many a line of could > would need to be touched if this was done. In this case, a PostgreSQL Schema is essentially the same as a MySQL Database. Use one database, and multiple schemas. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] Queries across multiple database
Although postgres itself doesn't seem to have a thing such as Informix' "synonym" which allows more-or-less transparent access to a table in a remote database, there is a utility in contrib directory of the postgres source called dblink, which allows access to different instance of postgres by opening connections. I have only played with it for testing and have no idea of its limitations, but it might serve your needs. Greg Williamson DBA GlobeXplorer LLC -Original Message- From: Garth Thompson [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 30, 2004 3:54 PM To: [EMAIL PROTECTED] Subject: [SQL] Queries across multiple database I am in the process of migrating the databases for an application from mysql to postgres. The application is uses several different databases. From what I have read, postgres still does not support queries across multiple databases. If this is still true, does anyone have any tricks to get around this? I'm sure this is a common problem for people migrating from mysql. The obvious answer is to just migrate everything into one larger postgres database, but I would like to avoid this if possible - many a line of could would need to be touched if this was done. Thanks, Garth ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] rules
Anslag "Stephan Szabo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 19 May 2004, Jie Liang wrote: > > > According to the document of rule: > > > > CREATE RULE rulename AS ON delete TO mytablename DO > > ( > > delete from aaa where id=OLD.id; > > Delete from bbb where id=OLD.id; > > Delete from ccc where id=OLD.id > > ); > > > > > > Should work, but it doesn't, what wrong with it? > > What is it doing and what version is this on? > > > ---(end of broadcast)--- > TIP 8: explain analyze is your friend > ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [SQL] finding if a foreign key is in use
On Tuesday 29 June 2004 07:19 pm, Phil Endecott wrote: > Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > in my app i have a table where the id serves as a foreign key for > > one or more other tables. if i want to delete a row in the table, > > i currently search the other tables where this table is referenced > > to see if the row is in use - and then, if not in use, permit > > deletion. > > Now if i want the delete button in my app to be disabled whenever > > a row that is in use is selected, searching the database every time > > would dramatically slow down the app. > > Basically you do have to do this search. But it won't be too slow if you > create an index on the foreign key. pity. thought postgres would have some function like 'in_use' to tell when a row that is used as a foreign key is in actual use and hence cannot be deleted. surely, in a database of millions of records, it wouldnt have search them all to find if the row is in use? in my case the id field serves as a foreign key in several tables -- regards kg http://www.onlineindianhotels.net - hotel bookings reservations in over 4600 hotels in India http://www.ootygolfclub.org ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html