[SQL] regarding grant option

2006-02-28 Thread AKHILESH GUPTA
hi all
this is akhilesh from india.i just want to ask one thing regarding grant operation??
i am using pgsql 8.0 on ubuntu 5.10 linux.
just tell me the procedure that how can i grant all permissions for a database to any of the other user???
i am using :-
:->> grant all privileges on database  to ;
GRANT
:->> grant all ON DATABASE  to ;
GRANT

and the query executes succesfully.
but at the other user end, she is not able to access the database given in the above query.
here i have to grant permissions to that user individually for each and every table by using:
:->> grant ALL ON  to ;
GRANT

and all the permissions are granted to that user for that particular table.

i want same results for the entire database.
plz help me it's urgent

-- Thanks & Regards,AkhileshDAV Institute of ManagementFaridabad(Haryana)GSM:-(+919891606064)  (+911744293789)"FAILURES CAN BE FORGIVEN BUT AIMING LOW IS A CRIME"


Re: [SQL] pg reserved words

2006-02-28 Thread Michael Glaesemann


On Feb 23, 2006, at 0:27 , Irina Gadassik wrote:

I am trying to create a table freeze and it seems "freeze" is a  
reserved word, but I don't see it in

the list. Also in a different table I cann't create a column freeze.


http://www.postgresql.org/docs/current/interactive/sql-keywords- 
appendix.html


I see FREEZE right between FREE and FROM. It's not an SQL keyword,  
but it is used in PostgreSQL withe VACUUM command.


http://www.postgresql.org/docs/current/interactive/sql-vacuum.html

Hope this helps.

Michael Glaesemann
grzm myrealbox com




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


Re: [SQL] how to add primary key to existing table with multiple

2006-02-28 Thread Stephan Szabo
On Thu, 23 Feb 2006, Daniel Joo wrote:

> I am trying to add another primary key to an existing table with two
> other primary keys.  I got the following error when I tried this
> command:

You only can have one primary key.  The table you gave has a single
primary key with two columns.  Are you trying to guarantee that expid
along is unique or that the set (probeid, tissueid, expid) is unique?

You can make expid UNIQUE and NOT NULL for the first case which is similar
to a primary key (although it's not a default foreign key target).  In the
second you can drop the current constraint and add one on the three
columns.

> Indexes:
>
> "extprobe2tissue_pkey" PRIMARY KEY, btree (probeid, tissueid)
> "extprobe2tissue_probeid" btree (probeid)
> "extprobe2tissue_tissueid" btree (tissueid)

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


Re: [SQL] grant select,... over schema

2006-02-28 Thread Michael James
GRANT ALL PRIVILEGES ON databaseName To username;

Michael Lee James | Database Administrator
d. 480-282-6043| c. 480-505-5802| f. 480-505-5801 
[EMAIL PROTECTED]
iCrossing, Inc. | Driving the Future of Advertising
New York | Chicago | Scottsdale | San Francisco
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of chester c young
Sent: Tuesday, February 28, 2006 9:35 AM
To: pgsql-sql@postgresql.org
Subject: [SQL] grant select,... over schema

is there any way to grant over all applicable objects in a schema,

> grant select on schema pop to public; <-- wrong

without specifically granting the select on each table?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

iCrossing Privileged and Confidential Information
This email message is for the sole use of the intended recipient(s) and may 
contain confidential and privileged information of iCrossing. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies of the original message.



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


Re: [SQL] Slow update SQL

2006-02-28 Thread Bungsuputra Linan
Hi Ken,

I used to have the same problem. In my computer, using date_part in WHERE
clause will always slow down the system when the table has plenty of rows.

My suggestion is try to change the query to:
... WHERE dxdate >= '2001-01-01';

I hope this helps.

Regards,
bungsu

- Original Message -
From: Ken Hill
To: Postgres Help
Sent: Tuesday, February 14, 2006 8:48 AM
Subject: [SQL] Slow update SQL


I'm experiencing a very slow query. The table contains 611,564 rows of data.
I vaccumed the table:

VACUUM ANALYZE ncccr10;

SELECT count(*) FROM ncccr10;
count

611564
(1 row)

When I try to analyze the query plan with:

EXPLAIN ANALYZE
UPDATE ncccr10
SET key = facilityno||'-'||
lastname||'-'||
sex||'-'||
ssno||'-'||
birthdate||'-'||
primarysit||'-'||
dxdate||'-'||
morphology3
WHERE date_part('year',dxdate) > '2000';

The query just never finishes (even 1 hour later). The colum key100 is
indexed, and I'm setting the value of this
column from other columns. Why is this so slow?


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


[SQL] dbLink Query

2006-02-28 Thread Richard C
Hi     When I execute the query:      SELECT *FROM dblink('dbname=Bas','SELECT id FROM person') AS t(a int)WHERE t.id > 9000 AND T.ID < 9050;     I receive the error message     ERROR:  function dblink("unknown", "unknown") does not exist     How do I install or setup the function dbLink so that I can use this feature.     Regards  Richard
		To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre.

[SQL] how to add primary key to existing table with multiple primary keys

2006-02-28 Thread Daniel Joo








Hi there,

 

I am trying to add another primary key to an existing table
with two other primary keys.  I got the following error when I tried this
command:

 

alter table extprobe2tissue ADD primary key (expid);

ERROR:  multiple primary keys for table "extprobe2tissue"
are not allowed

 

The details of the extprobe2tissue table is: 

 

\d extprobe2tissue;

  Table
"public.extprobe2tissue"

   Column   
| 
Type  | Modifiers

-++---

 probeid |
integer   
| not null

 tissueid    |
integer   
| not null

 value   | double
precision   | not null

 entrydate   |
date  
| not null

 description | character varying(200) |

 qval    |
double precision   |

 expid   |
integer   
| not null

Indexes:

    "extprobe2tissue_pkey" PRIMARY
KEY, btree (probeid, tissueid)

    "extprobe2tissue_probeid" btree
(probeid)

    "extprobe2tissue_tissueid"
btree (tissueid)

Foreign-key constraints:

    "extprobe2tissue_tissueid_fkey"
FOREIGN KEY (tissueid) REFERENCES tissue(tissueid)

    "extprobe2tissue_probeid_fkey"
FOREIGN KEY (probeid) REFERENCES extprobe(probeid)

 

Any suggestion would be much appreciated.

 

Thanks!  








[SQL] pg reserved words

2006-02-28 Thread Irina Gadassik

Hello,
I need some help.
I am trying to create a table freeze and it seems "freeze" is a reserved 
word, but I don't see it in

the list. Also in a different table I cann't create a column freeze.
However it is possible in MySQL and Ingres.
Thank you,
Irina


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

  http://archives.postgresql.org


Re: [SQL] ORDER BY with LTREE

2006-02-28 Thread Axel Straschil

Hello Michael!


Below is a simple example using the data from your original message


Thanks for the example, that realy helps me!

Lg,
AXEL.

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


Re: [SQL] Slow update SQL

2006-02-28 Thread Ken Hill




bungsu,

That does make the query work a bit faster. Thanks!

On Mon, 2006-02-27 at 09:42 +0700, Bungsuputra Linan wrote:


Hi Ken,

I used to have the same problem. In my computer, using date_part in WHERE
clause will always slow down the system when the table has plenty of rows.

My suggestion is try to change the query to:
... WHERE dxdate >= '2001-01-01';

I hope this helps.

Regards,
bungsu

- Original Message -
From: Ken Hill
To: Postgres Help
Sent: Tuesday, February 14, 2006 8:48 AM
Subject: [SQL] Slow update SQL


I'm experiencing a very slow query. The table contains 611,564 rows of data.
I vaccumed the table:

VACUUM ANALYZE ncccr10;

SELECT count(*) FROM ncccr10;
count

611564
(1 row)

When I try to analyze the query plan with:

EXPLAIN ANALYZE
UPDATE ncccr10
SET key = facilityno||'-'||
lastname||'-'||
sex||'-'||
ssno||'-'||
birthdate||'-'||
primarysit||'-'||
dxdate||'-'||
morphology3
WHERE date_part('year',dxdate) > '2000';

The query just never finishes (even 1 hour later). The colum key100 is
indexed, and I'm setting the value of this
column from other columns. Why is this so slow?







Re: [SQL] plsql / time statement

2006-02-28 Thread Steve Crawford

Daniel Caune wrote:

Hi,

 

Is there any option to set so that psql provides the execution time of 
each SQL statement executed?


\timing (either as a manual command or as a default in your .psqlrc file).

Cheers,
Steve

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

  http://archives.postgresql.org


[SQL] plsql / time statement

2006-02-28 Thread Daniel Caune








Hi,

 

Is there any option to set so that psql provides the execution
time of each SQL statement executed?

 

Regards,

 

--

Daniel CAUNE

Ubisoft Online Technology

(514) 4090 2040 ext. 5418

 








Re: [SQL] grant select,... over schema

2006-02-28 Thread chester c young
do not want to grant ALL PRIVILEGES to user, only SELECT - do not want
PUBLIC to have any dml priveleges on this schema

--- Michael James <[EMAIL PROTECTED]> wrote:

> GRANT ALL PRIVILEGES ON databaseName To username;
> 
> 
> is there any way to grant over all applicable objects in a schema,
> 
> > grant select on schema pop to public; <-- wrong
> 
> without specifically granting the select on each table?
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


[SQL] grant select,... over schema

2006-02-28 Thread chester c young
is there any way to grant over all applicable objects in a schema,

> grant select on schema pop to public; <-- wrong

without specifically granting the select on each table?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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