[Info-Ingres] seleting from tablename without "ownername."

badgirljo at hotmail.com badgirljo at hotmail.com
Mon Mar 12 07:32:16 CDT 2007


On 7 Mar, 19:09, Philip Lewis <f... at andrew.seeemmyou.eeedeeyou> wrote:
> So, we've an older install of ingres: OI 2.0
> most of our tables are created using the ingres user and have
> insert/delete/etc persmissions granted...
>
> lets say ingres user does:
> create table selecttest as select 1;
> grant all on selecttest to public;
>
> now if a user (other than ingres) goes into terminal monitor and types:
> select * from selecttest;
>
> they will see the table fine.
>
> We were test migrating from the old ingres to Ingres II 9.0.4
> (since support expired) and would like this behavior duplicated,
> but it doesn't seem to be... you have to specify the username
>
> select * from ingres.selecttest;
>
> Is there some switch to throw, does the table have to be created by
> certain user(s) for this to work, or has this behavior been phased out?
>
> Note, even on the old system If a user that isn't ingres does the same
> thing (create/grant all), you have to type: select * from
> username.selecttest;
>
> Mostly I'm worried about all the openroad apps and scripts we've written.
>
> Probably a dirt easy answer... but i didn't see it in the migration
> guides... (just skimming.... I'm reading more in depth right now.)
>
> Thanks in advance!
> --
> flip

Hi Philip,

I've just tried this on 9.0.4 without any problems:

C:\Documents and Settings>sql testdb -u$ingres
INGRES TERMINAL MONITOR Copyright 2005 Ingres Corporation
Ingres 2006 Microsoft Windows 32-bit Version II 9.0.4 (int.w32/105)
login
Mon Mar 12 12:21:55 2007

continue
* create table test (col1 date, col2 char(20), col3 int); \g
Executing . . .

continue
* grant all on test to public; \g
Executing . . .

continue
* help \g
Executing . . .

Name                               Owner
Type

test                               $ingres
table
(1 row)
continue
* \q
Your SQL statement(s) have been committed.

Ingres 2006 Version II 9.0.4 (int.w32/105) logout
Mon Mar 12 12:23:33 2007

C:\Documents and Settings>sql testdb -ubob
INGRES TERMINAL MONITOR Copyright 2005 Ingres Corporation
Ingres 2006 Microsoft Windows 32-bit Version II 9.0.4 (int.w32/105)
login
Mon Mar 12 12:23:43 2007

continue
* select * from test; \g
Executing . . .


+-------------------------+--------------------+-------------+
|col1                     |col2                |col3         |
+-------------------------+--------------------+-------------+
+-------------------------+--------------------+-------------+
(0 rows)
continue
* \q
Your SQL statement(s) have been committed.

Ingres 2006 Version II 9.0.4 (int.w32/105) logout
Mon Mar 12 12:23:57 2007

C:\Documents and Settings>

If you do a help from ISQL or SQL does it show more than one
object(table) with the same name but different owners? and hence why
it wants the owner to determine which table to use.

Otherwise you could use public synonyms :)

Jo.



More information about the Info-Ingres mailing list