[ADMIN] how to alter sequence.

2002-12-04 Thread raja kumar thatte
Hai friends,
I have a sequence called raj_seq with max value 3000.
I have a table, with one field haveing
nextvalu('raj_seq') as default value.;
now i wanted to increase the max value of the raj_seq
to 999.
How to do this change?
If i drop and recreate the raj_seq, then i have to
recreate the table and all triggers working on that
table.But it is not an acceptable solution.
So with out droping raj_seq , how do I solve this
problem.
Thanks in advance.
have a nice time.
raja



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

http://archives.postgresql.org



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread Dan Langille
On 4 Dec 2002 at 4:29, raja kumar thatte wrote:

> Hai friends,
> I have a sequence called raj_seq with max value 3000.
> I have a table, with one field haveing
> nextvalu('raj_seq') as default value.;
> now i wanted to increase the max value of the raj_seq
> to 999.
> How to do this change?

http://www.postgresql.org/idocs/index.php?functions-sequence.html
Look for setval
-- 
Dan Langille : http://www.langille.org/


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



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread raja kumar thatte
Hai friend,
Thanks. But I wanted to change the maximum value but
not current value. How to change the maximum value of
a sequence

raja


--- Dan Langille <[EMAIL PROTECTED]> wrote:
> On 4 Dec 2002 at 4:29, raja kumar thatte wrote:
> 
> > Hai friends,
> > I have a sequence called raj_seq with max value
> 3000.
> > I have a table, with one field haveing
> > nextvalu('raj_seq') as default value.;
> > now i wanted to increase the max value of the
> raj_seq
> > to 999.
> > How to do this change?
> 
>
http://www.postgresql.org/idocs/index.php?functions-sequence.html
> Look for setval
> -- 
> Dan Langille : http://www.langille.org/
> 
> 
> ---(end of
> broadcast)---
> TIP 4: Don't 'kill -9' the postmaster


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread Dan Langille
On 4 Dec 2002 at 5:20, raja kumar thatte wrote:

> Hai friend,
> Thanks. But I wanted to change the maximum value but
> not current value. How to change the maximum value of
> a sequence

I'm sorry.  I shouldn't reply to questions first thing in the 
morning.

That I don't know, but I'm sure it can be done someone else will 
know.
-- 
Dan Langille : http://www.langille.org/


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread Egon Reetz
Drop the sequence and recreate with a min. value greater your last value and
the new max. value.

Egon


raja kumar thatte wrote:

> Hai friends,
> I have a sequence called raj_seq with max value 3000.
> I have a table, with one field haveing
> nextvalu('raj_seq') as default value.;
> now i wanted to increase the max value of the raj_seq
> to 999.
> How to do this change?
> If i drop and recreate the raj_seq, then i have to
> recreate the table and all triggers working on that
> table.But it is not an acceptable solution.
> So with out droping raj_seq , how do I solve this
> problem.
> Thanks in advance.
> have a nice time.
> raja
>
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread Egon Reetz
I meant start value (inst. min.).

Egon Reetz wrote:

> Drop the sequence and recreate with a min. value greater your last value and
> the new max. value.
>
> Egon
>
> raja kumar thatte wrote:
>
> > Hai friends,
> > I have a sequence called raj_seq with max value 3000.
> > I have a table, with one field haveing
> > nextvalu('raj_seq') as default value.;
> > now i wanted to increase the max value of the raj_seq
> > to 999.
> > How to do this change?
> > If i drop and recreate the raj_seq, then i have to
> > recreate the table and all triggers working on that
> > table.But it is not an acceptable solution.
> > So with out droping raj_seq , how do I solve this
> > problem.
> > Thanks in advance.
> > have a nice time.
> > raja
> >
> > __
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.yahoo.com
> >
> > ---(end of broadcast)---
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
>
> ---(end of broadcast)---
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread raja kumar thatte
Thsnkd
--- Egon Reetz <[EMAIL PROTECTED]> wrote:
> I meant start value (inst. min.).
> 
> Egon Reetz wrote:
> 
> > Drop the sequence and recreate with a min. value
> greater your last value and
> > the new max. value.
> >
> > Egon
> >
> > raja kumar thatte wrote:
> >
> > > Hai friends,
> > > I have a sequence called raj_seq with max value
> 3000.
> > > I have a table, with one field haveing
> > > nextvalu('raj_seq') as default value.;
> > > now i wanted to increase the max value of the
> raj_seq
> > > to 999.
> > > How to do this change?
> > > If i drop and recreate the raj_seq, then i have
> to
> > > recreate the table and all triggers working on
> that
> > > table.But it is not an acceptable solution.
> > > So with out droping raj_seq , how do I solve
> this
> > > problem.
> > > Thanks in advance.
> > > have a nice time.
> > > raja
> > >
> > >
> __
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > > http://mailplus.yahoo.com
> > >
> > > ---(end of
> broadcast)---
> > > TIP 6: Have you searched our list archives?
> > >
> > > http://archives.postgresql.org
> >
> > ---(end of
> broadcast)---
> > TIP 5: Have you checked our extensive FAQ?
> >
> >
> http://www.postgresql.org/users-lounge/docs/faq.html
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread raja kumar thatte
Thanks
--- Egon Reetz <[EMAIL PROTECTED]> wrote:
> I meant start value (inst. min.).
> 
> Egon Reetz wrote:
> 
> > Drop the sequence and recreate with a min. value
> greater your last value and
> > the new max. value.
> >
> > Egon
> >
> > raja kumar thatte wrote:
> >
> > > Hai friends,
> > > I have a sequence called raj_seq with max value
> 3000.
> > > I have a table, with one field haveing
> > > nextvalu('raj_seq') as default value.;
> > > now i wanted to increase the max value of the
> raj_seq
> > > to 999.
> > > How to do this change?
> > > If i drop and recreate the raj_seq, then i have
> to
> > > recreate the table and all triggers working on
> that
> > > table.But it is not an acceptable solution.
> > > So with out droping raj_seq , how do I solve
> this
> > > problem.
> > > Thanks in advance.
> > > have a nice time.
> > > raja
> > >
> > >
> __
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > > http://mailplus.yahoo.com
> > >
> > > ---(end of
> broadcast)---
> > > TIP 6: Have you searched our list archives?
> > >
> > > http://archives.postgresql.org
> >
> > ---(end of
> broadcast)---
> > TIP 5: Have you checked our extensive FAQ?
> >
> >
> http://www.postgresql.org/users-lounge/docs/faq.html
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

http://archives.postgresql.org



[ADMIN] how to cancel a query ?

2002-12-04 Thread Andreas Schmitz

Hello,

ist there any way to cancel a user query as dba ?

regards 

-andreas


-- 
Andreas Schmitz - Phone +49 201 8501 318
Cityweb-Technik-Service-Gesellschaft mbH
Friedrichstr. 12 - Fax +49 201 8501 104
45128 Essen - email [EMAIL PROTECTED]


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [ADMIN] how to cancel a query ?

2002-12-04 Thread Tom Lane
Andreas Schmitz <[EMAIL PROTECTED]> writes:
> ist there any way to cancel a user query as dba ?

Send a SIGINT to the backend process running that query, eg

kill -INT 

This has the same effect as a user-requested cancel (eg ^C in psql).

regards, tom lane

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [ADMIN] how to cancel a query ?

2002-12-04 Thread Bruce Momjian
Tom Lane wrote:
> Andreas Schmitz <[EMAIL PROTECTED]> writes:
> > ist there any way to cancel a user query as dba ?
> 
> Send a SIGINT to the backend process running that query, eg
> 
>   kill -INT 
> 
> This has the same effect as a user-requested cancel (eg ^C in psql).

And finally documented in 7.3.  ;-)

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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



Re: [ADMIN] URGENT: undoing a mistake

2002-12-04 Thread Dan Langille
On 31 Oct 2002 at 10:18, Nick Sayer wrote:

> Andrew Perrin wrote:
> 
> >- Do a formal backup more often
> >
> >  
> >
> For what it's worth, the FreeBSD "port" 
> (http://cvsweb.freebsd.org/ports/databases/postgresql7/) for
> PostgreSQL contains a most excellent daily maintenance script (as
> written it's a FreeBSD "periodic" script, but it's more or less
> suitable to be a cron job). It does a pg_dump of all the databases
> (with blobs, as a -Fc) and vacuums all the tables.

For those looking for this script:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/databases/postgresql7/file
s/502.pgsql
-- 
Dan Langille : http://www.langille.org/


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[ADMIN] alter database name length

2002-12-04 Thread Ralf Praschak
hello list!

i want to use database names that are longer than 32 characters.
i found that in pg_database the field datname is responsible for this

how can i change the length?
i am using postgresql 7.2.1

greets
ralf praschak



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [ADMIN] alter database name length

2002-12-04 Thread Bruce Momjian

We have increased identifier length in 7.3, and in 7.2 you can alter
include/postgres_ext.h NAMEDATALEN and recompile everything, including
client applications/interfaces.

There is another limit, but one good thing is that in 7.2, I think,
SM_DATABASE in src/include/pqcomm.h is already 64, so if you up the
NAMEDATALEN, it should work.

---

Ralf Praschak wrote:
> hello list!
> 
> i want to use database names that are longer than 32 characters.
> i found that in pg_database the field datname is responsible for this
> 
> how can i change the length?
> i am using postgresql 7.2.1
> 
> greets
> ralf praschak
> 
> 
> 
> ---(end of broadcast)---
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> 

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [ADMIN] Disabling triggers on a relation.

2002-12-04 Thread shreedhar
Hi Bhuvan & Mallah,

Have you checked desabling of triggers. What reltriggers represent. If we
set it as '0' to enable by what value it has to be updated.

Sreedhar
- Original Message -
From: "Bhuvan A" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 3:16 PM
Subject: Re: [ADMIN] Disabling triggers on a relation.


>
> > What is the correct method of temporarily
> > disabling all triggers from a table?
>
> Disable:
> db=# update pg_class set reltriggers = '0' where relname = 'your_table';
>
> Enable:
> db=# update pg_class set reltriggers = (select count(*) from pg_trigger
> where pg_class.oid = tgrelid) where relname = 'your_table';
>
> >
> >
> > also is there any command/function  to show the
> > trigger defination ? like pg_index_def does for indexes?
> >
>
> Not sure.
>
> regards,
> bhuvaneswaran
>
>
> ---(end of broadcast)---
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
>


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[ADMIN] What will be the entry in pg_hba.conf to connect as LocalHost

2002-12-04 Thread shreedhar
To Connct database as the following parameters.

host : 'localhost'
username : 'xxx'
password : 'xxx'
database : 'xx'

What will be the entry in pg_hba.conf

I gave the entry as
host  all 127.0.0.1 255.255.255.0 password.

Which is rejecting user xxx. User 'xxx' is already in pg_shadow.

Cheers,
Sreedhar Bhaskararaju 1,2nd Main Road, KottuGardens, Chennai - 600 085 Ph :
4475111 Email : [EMAIL PROTECTED]


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread Oliver Elphick
On Wed, 2002-12-04 at 12:29, raja kumar thatte wrote:
> Hai friends,
> I have a sequence called raj_seq with max value 3000.
...
> now i wanted to increase the max value of the raj_seq
> to 999.
> How to do this change?
> If i drop and recreate the raj_seq, then i have to
> recreate the table and all triggers working on that
> table.But it is not an acceptable solution.
> So with out droping raj_seq , how do I solve this
> problem.

Unfortunately there doesn't seem to be any easy way to do this.  There
is no ALTER SEQUENCE command and you can't use UPDATE on a sequence.

Hackers: Could this be a TODO item for 7.4?


The easiest way to do this at present is probably to dump the database,
edit the dump to change the sequence max_value and then recreate the
database from the edited dump.  I presume you used CREATE SEQUENCE in
order to get such a low max_value.  If it were created from a SERIAL
datatype, you would also have to edit the table definition to use a
pre-created sequence.  There is no means of specifying a max_value using
SERIAL.

-- 
Oliver Elphick <[EMAIL PROTECTED]>
LFIX Limited


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [HACKERS] [ADMIN] how to alter sequence.

2002-12-04 Thread Joel Burton
On Wed, Dec 04, 2002 at 09:33:52AM -0800, Dustin Sallings wrote:
> Around 20:41 on Dec 4, 2002, Hannu Krosing said:
> 
>   What's wrong with this:
> 
> dustin=# create sequence test_seq;
> CREATE SEQUENCE
> dustin=# select nextval('test_seq');
>  nextval
> -
>1
> (1 row)
> 
> dustin=# select setval('test_seq', );
>  setval
> 
>
> (1 row)
> 
> dustin=# select nextval('test_seq');
>  nextval
> -
>1
> (1 row)

Dustin --

The thread here is about how to raise the *max* value for the sequence,
not how to set the current value higher. The sequence in question was
created with a too-low maximum value (see help on CREATE SEQUENCE for
options); the user now wants to raise it.

- J.
-- 

Joel BURTON  |  [EMAIL PROTECTED]  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant

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

http://archives.postgresql.org



Re: [HACKERS] [ADMIN] how to alter sequence.

2002-12-04 Thread Oliver Elphick
On Wed, 2002-12-04 at 17:33, Dustin Sallings wrote:
>   What's wrong with this:
> 
> dustin=# create sequence test_seq;
> CREATE SEQUENCE
> dustin=# select nextval('test_seq');
>  nextval
> -
>1
> (1 row)
> 
> dustin=# select setval('test_seq', );
>  setval
> 
>
> (1 row)
> 
> dustin=# select nextval('test_seq');
>  nextval
> -
>1
> (1 row)

It's not the issue.  The original question was how to change the upper
limit of the sequence's range, not its current value.

junk=# create sequence foo_seq maxvalue 3000;
CREATE SEQUENCE
junk=# select nextval('foo_seq');
 nextval 
-
   1
(1 row)

junk=# select setval('foo_seq', 99);
ERROR:  foo_seq.setval: value 99 is out of bounds (1,3000)

-- 
Oliver Elphick <[EMAIL PROTECTED]>
LFIX Limited


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread Bruce Momjian
Oliver Elphick wrote:
> On Wed, 2002-12-04 at 12:29, raja kumar thatte wrote:
> > Hai friends,
> > I have a sequence called raj_seq with max value 3000.
> ...
> > now i wanted to increase the max value of the raj_seq
> > to 999.
> > How to do this change?
> > If i drop and recreate the raj_seq, then i have to
> > recreate the table and all triggers working on that
> > table.But it is not an acceptable solution.
> > So with out droping raj_seq , how do I solve this
> > problem.
> 
> Unfortunately there doesn't seem to be any easy way to do this.  There
> is no ALTER SEQUENCE command and you can't use UPDATE on a sequence.

Gee, I thought they could just update the sequence table, but I see:

test=> update yy set max_value = 100;
ERROR:  You can't change sequence relation yy

> Hackers: Could this be a TODO item for 7.4?

Added to TODO:

* Add ALTER SEQUENCE to modify min/max/increment/cache/cycle values

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

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

http://archives.postgresql.org



Re: [ADMIN] how to alter sequence.

2002-12-04 Thread raja kumar thatte
Thanks everybody.


--- Bruce Momjian <[EMAIL PROTECTED]> wrote:
> Oliver Elphick wrote:
> > On Wed, 2002-12-04 at 12:29, raja kumar thatte
> wrote:
> > > Hai friends,
> > > I have a sequence called raj_seq with max value
> 3000.
> > ...
> > > now i wanted to increase the max value of the
> raj_seq
> > > to 999.
> > > How to do this change?
> > > If i drop and recreate the raj_seq, then i have
> to
> > > recreate the table and all triggers working on
> that
> > > table.But it is not an acceptable solution.
> > > So with out droping raj_seq , how do I solve
> this
> > > problem.
> > 
> > Unfortunately there doesn't seem to be any easy
> way to do this.  There
> > is no ALTER SEQUENCE command and you can't use
> UPDATE on a sequence.
> 
> Gee, I thought they could just update the sequence
> table, but I see:
>   
>   test=> update yy set max_value = 100;
>   ERROR:  You can't change sequence relation yy
> 
> > Hackers: Could this be a TODO item for 7.4?
> 
> Added to TODO:
> 
> * Add ALTER SEQUENCE to modify
> min/max/increment/cache/cycle values
> 
> -- 
>   Bruce Momjian| 
> http://candle.pha.pa.us
>   [EMAIL PROTECTED]   |  (610)
> 359-1001
>   +  If your life is a hard drive, |  13 Roberts
> Road
>   +  Christ can be your backup.|  Newtown
> Square, Pennsylvania 19073
> 
> ---(end of
> broadcast)---
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

http://archives.postgresql.org