471,066 Members | 924 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

How do I disable: Adding missing FROM-clause

I know that PSQL has the cool feature of doing: Adding missing FROM-clause

But I want to disable it, because its silent adding can allow a bad SQL statement to execute a
cartesian select (when in fact it should error out).

I searched and found references to changing the postgresql.conf with:
add_missing_from = false
enable_implicited_join = false

But neither one of these seems to disable the functionality (I did a reload after making the change)

Do I have to completely stop the db to make the change? Or is there something else I should be
doing to disable it?

Thanks

Terry Fielder
Manager Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
te***@greatgulfhomes.com
Fax: (416) 441-9085
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #1
4 1350
<te***@ashtonwoodshomes.com> writes:
I searched and found references to changing the postgresql.conf with:
add_missing_from = false
This is correct.
enable_implicited_join = false
This is not.
But neither one of these seems to disable the functionality (I did a reload after making the change)


I'm betting that the postmaster is ignoring the file completely because
of the bogus enable_implicited_join variable. Did you look for errors
in the postmaster log?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2
Tom Lane wrote:
<te***@ashtonwoodshomes.com> writes:
I searched and found references to changing the postgresql.conf with:
add_missing_from = false

This is correct.

Just a suggestion about this:

how about implementing more options like
off/false, cross (join), natural (join)

Thought about this when reading
http://en.wikipedia.org/wiki/PostgreSQL

This site says:
| A typical search might look like this:
|
| SELECT u.* FROM user u, address a WHERE a.city='New York'
| AND a.user_name=u.user_name
|
| PostgreSQL can explicitly define the relationship between users
| and addresses. Once defined, the address becomes a property of
| the user, so the search can be greatly simplified to:
|
| SELECT * FROM user WHERE address.city='New York'

This example isn't working for me "as it is".
What relationships have to be defined and how?
Normal foreign keys aren't working.

Can anybody tell me how to accomplish this?
Thanks in advance

Sebastian

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

Nov 23 '05 #3
On Fri, Sep 24, 2004 at 10:41:04AM +0200, Sebastian Böck wrote:
Thought about this when reading
http://en.wikipedia.org/wiki/PostgreSQL

This site says:
| A typical search might look like this:
|
| SELECT u.* FROM user u, address a WHERE a.city='New York'
| AND a.user_name=u.user_name
|
| PostgreSQL can explicitly define the relationship between users
| and addresses. Once defined, the address becomes a property of
| the user, so the search can be greatly simplified to:
|
| SELECT * FROM user WHERE address.city='New York'

This example isn't working for me "as it is".
What relationships have to be defined and how?
Normal foreign keys aren't working.
I'm pretty sure this is wrong. I've never seen anything in PostgreSQL
that might do what that bit says. There are some other inaccuracies too
I think.
--
Martijn van Oosterhout <kl*****@svana.org> http://svana.org/kleptog/ Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFBU+AmY5Twig3Ge+YRAmNgAJsEuG9HprYNDoAQXlPCH7 iUcRDR+ACfRo4p
j522DsVVTOVJDD/jc4fBFWI=
=4clU
-----END PGP SIGNATURE-----

Nov 23 '05 #4
Martijn van Oosterhout <kl*****@svana.org> writes:
On Fri, Sep 24, 2004 at 10:41:04AM +0200, Sebastian B=F6ck wrote:
Thought about this when reading
http://en.wikipedia.org/wiki/PostgreSQL
|
| PostgreSQL can explicitly define the relationship between users
| and addresses. Once defined, the address becomes a property of
| the user, so the search can be greatly simplified to:
| SELECT * FROM user WHERE address.city='New York'
I'm pretty sure this is wrong. I've never seen anything in PostgreSQL
that might do what that bit says.


It's possible that this is an accurate description of something that
would work back in the PostQUEL days. It's certainly bogus now, though.
Anyone want to go fix it?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Sinity | last post: by
6 posts views Thread by Al Cohen | last post: by
16 posts views Thread by Barry Gilmore | last post: by
5 posts views Thread by Tanja Krammer | last post: by
10 posts views Thread by Gary Jefferson | last post: by
reply views Thread by leo001 | last post: by

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.