pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHidden Select
6+ messages / 2 participants
[nested] [flat]
* Hidden Select
@ 2001-06-08 08:54 Luis Sousa <llsousa@ualg.pt>
0 siblings, 1 reply; 6+ messages in thread
From: Luis Sousa @ 2001-06-08 08:54 UTC (permalink / raw)
To: pgsql-sql
I have a query that joins several table with some restrictions.
I want to take out those restrictions from the query and create a view
that does not show the fields that are used to restrict the data, but in
some way, i can restrict that data when i call the view.
Is it possible to hide some fields in the view so it could be possible
to restrict that data ????
Best Regards
Luis Sousa
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Hidden Select
@ 2001-06-08 16:31 Peter Eisentraut <peter_e@gmx.net>
parent: Luis Sousa <llsousa@ualg.pt>
0 siblings, 1 reply; 6+ messages in thread
From: Peter Eisentraut @ 2001-06-08 16:31 UTC (permalink / raw)
To: Luis Sousa <llsousa@ualg.pt>; +Cc: pgsql-sql
Luis Sousa writes:
> I have a query that joins several table with some restrictions.
> I want to take out those restrictions from the query and create a view
> that does not show the fields that are used to restrict the data, but in
> some way, i can restrict that data when i call the view.
Do you mean like this?
create table A (id int, content text);
create table B (id int, stuff numeric);
create view C as select A.content, B.stuff from A, B where A.id = B.id;
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Hidden Select
@ 2001-06-11 16:27 Luis Sousa <llsousa@ualg.pt>
parent: Peter Eisentraut <peter_e@gmx.net>
0 siblings, 1 reply; 6+ messages in thread
From: Luis Sousa @ 2001-06-11 16:27 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-sql
Suposing your example:
Now i want to do a query to the view like this:
SELECT * FROM C WHERE id=1;
I whant to chose the id, but that id isn't in my select list !!!?????
I hope you understand what i mean
Best regards
Luis Sousa
Peter Eisentraut wrote:
> Luis Sousa writes:
>
> > I have a query that joins several table with some restrictions.
> > I want to take out those restrictions from the query and create a view
> > that does not show the fields that are used to restrict the data, but in
> > some way, i can restrict that data when i call the view.
>
> Do you mean like this?
>
> create table A (id int, content text);
> create table B (id int, stuff numeric);
> create view C as select A.content, B.stuff from A, B where A.id = B.id;
>
> --
> Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Hidden Select
@ 2001-06-11 16:34 Peter Eisentraut <peter_e@gmx.net>
parent: Luis Sousa <llsousa@ualg.pt>
0 siblings, 1 reply; 6+ messages in thread
From: Peter Eisentraut @ 2001-06-11 16:34 UTC (permalink / raw)
To: Luis Sousa <llsousa@ualg.pt>; +Cc: pgsql-sql
Luis Sousa writes:
> Suposing your example:
>
> Now i want to do a query to the view like this:
>
> SELECT * FROM C WHERE id=1;
>
> I whant to chose the id, but that id isn't in my select list !!!?????
Then you will have to define your view differently.
> > Do you mean like this?
> >
> > create table A (id int, content text);
> > create table B (id int, stuff numeric);
> > create view C as select A.content, B.stuff from A, B where A.id = B.id;
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Hidden Select
@ 2001-06-12 08:27 Luis Sousa <llsousa@ualg.pt>
parent: Peter Eisentraut <peter_e@gmx.net>
0 siblings, 1 reply; 6+ messages in thread
From: Luis Sousa @ 2001-06-12 08:27 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-sql
How's that ??
How can i define the rule to do that ?
Peter Eisentraut wrote:
> Luis Sousa writes:
>
> > Suposing your example:
> >
> > Now i want to do a query to the view like this:
> >
> > SELECT * FROM C WHERE id=1;
> >
> > I whant to chose the id, but that id isn't in my select list !!!?????
>
> Then you will have to define your view differently.
>
> > > Do you mean like this?
> > >
> > > create table A (id int, content text);
> > > create table B (id int, stuff numeric);
> > > create view C as select A.content, B.stuff from A, B where A.id = B.id;
>
> --
> Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Hidden Select
@ 2001-06-12 14:46 Peter Eisentraut <peter_e@gmx.net>
parent: Luis Sousa <llsousa@ualg.pt>
0 siblings, 0 replies; 6+ messages in thread
From: Peter Eisentraut @ 2001-06-12 14:46 UTC (permalink / raw)
To: Luis Sousa <llsousa@ualg.pt>; +Cc: pgsql-sql
Luis Sousa writes:
> How's that ??
>
> How can i define the rule to do that ?
You just have to make the id column part of the view.
>
>
> Peter Eisentraut wrote:
>
> > Luis Sousa writes:
> >
> > > Suposing your example:
> > >
> > > Now i want to do a query to the view like this:
> > >
> > > SELECT * FROM C WHERE id=1;
> > >
> > > I whant to chose the id, but that id isn't in my select list !!!?????
> >
> > Then you will have to define your view differently.
> >
> > > > Do you mean like this?
> > > >
> > > > create table A (id int, content text);
> > > > create table B (id int, stuff numeric);
> > > > create view C as select A.content, B.stuff from A, B where A.id = B.id;
> >
> > --
> > Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2001-06-12 14:46 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-08 08:54 Hidden Select Luis Sousa <llsousa@ualg.pt>
2001-06-08 16:31 ` Peter Eisentraut <peter_e@gmx.net>
2001-06-11 16:27 ` Luis Sousa <llsousa@ualg.pt>
2001-06-11 16:34 ` Peter Eisentraut <peter_e@gmx.net>
2001-06-12 08:27 ` Luis Sousa <llsousa@ualg.pt>
2001-06-12 14:46 ` Peter Eisentraut <peter_e@gmx.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox