Re: [SQL] Sequences

2009-07-06 Thread Andre Rothe
Thanks, I have used SELECT sequence_name FROM information_schema.sequences WHERE sequence_catalog=? AND sequence_schema=? and then I can use select * from It seems to work :-) Andre Chris Browne wrote: Andre Rothe writes: Where are stored the sequence information? How I can query the pr

[SQL] Sequences

2009-07-06 Thread Andre Rothe
Hi! Where are stored the sequence information? How I can query the properties of a sequence like increment, max/min value, cache? I'm looking for a table like user_sequences in Oracle, where I can query all of my sequences. Thanks Andre -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.o

Re: [SQL] Sequences

2009-07-04 Thread Scott Marlowe
Easiest way is with pg_dump -s -t tablename dbname On Sat, Jul 4, 2009 at 6:35 AM, Jasmin Dizdarevic wrote: > Nice Information. Does somebody know how to get the complete > create-statement of an existing table/view? > > 2009/7/3 Chris Browne >> >> Andre Rothe writes: >> > Where are stored the s

Re: [SQL] Sequences

2009-07-04 Thread Jasmin Dizdarevic
Nice Information. Does somebody know how to get the complete create-statement of an existing table/view? 2009/7/3 Chris Browne > Andre Rothe writes: > > Where are stored the sequence information? How I can query the > > properties of a sequence like increment, max/min value, cache? > > I'm look

Re: [SQL] Sequences

2009-07-04 Thread Chris Browne
Andre Rothe writes: > Where are stored the sequence information? How I can query the > properties of a sequence like increment, max/min value, cache? > I'm looking for a table like user_sequences in Oracle, where I > can query all of my sequences. cbbrowne=# create sequence foo; CREATE SEQUENCE c

Re: [SQL] Sequences problem

2007-08-17 Thread Scott Marlowe
On 8/17/07, Judith <[EMAIL PROTECTED]> wrote: > Hello everybody, I have a question related with sequences. > > When I init a sesion with my db, if a do the next sentence: > > SELECT currval('pagos_id_pago_seq'); > > > return this: >ERROR: the relation doesn't exist > (or s

Re: [SQL] Sequences problem

2007-08-17 Thread Andrew Sullivan
On Fri, Aug 17, 2007 at 04:33:04PM -0500, Judith wrote: > When I init a sesion with my db, if a do the next sentence: > >SELECT currval('pagos_id_pago_seq'); > > > return this: > ERROR: the relation doesn't exist >(or somethimg like that, because the message is in spanish) You _must

[SQL] Sequences problem

2007-08-17 Thread Judith
Hello everybody, I have a question related with sequences. When I init a sesion with my db, if a do the next sentence: SELECT currval('pagos_id_pago_seq'); return this: ERROR: the relation doesn't exist (or somethimg like that, because the message is in spanish) but if I

Re: [SQL] SEQUENCES

2006-10-03 Thread Bruno Wolff III
On Mon, Oct 02, 2006 at 13:39:38 -0300, Rodrigo Sakai <[EMAIL PROTECTED]> wrote: > Hi all, > > > > I need to get all sequences and their respective current values! Is there > any catalog table or any other away to get this??? You can get their names from pg_class (with relkind = 'S') and

Re: [SQL] SEQUENCES

2006-10-02 Thread Thomas Kellerer
Rodrigo Sakai wrote on 02.10.2006 18:39: Hi all, I need to get all sequences and their respective current values! Is there any catalog table or any other away to get this??? Quote from the manual at: http://www.postgresql.org/docs/8.1/static/catalog-pg-class.html "The catalog pg_cl

Re: [SQL] SEQUENCES

2006-10-02 Thread Andrew Sullivan
On Mon, Oct 02, 2006 at 01:39:38PM -0300, Rodrigo Sakai wrote: > > I need to get all sequences and their respective current values! Is there > any catalog table or any other away to get this??? Here's a quick way to do it in a shell script, although it'd be sort of inefficient: for name in `ps

[SQL] SEQUENCES

2006-10-02 Thread Rodrigo Sakai
  Hi all,     I need to get all sequences and their respective current values! Is there any catalog table or any other away to get this???     Thanks in advance.

Re: [SQL] Sequences, values still increased

2006-07-19 Thread Chris Browne
Paul Maier <[EMAIL PROTECTED]> writes: > Hello everybody, > > Why does... > > BEGIN; > SELECT nextval('test.test_seq') AS id; > ROLLBACK; > > ...still increase the sequence after aborting the transaction? This > nextval-command should be reverted after rolling back, right? Same with an > ABORT: > >

RE: [SQL] sequences in functions

2000-08-18 Thread Graham Vickrage
done as two seperate calls in my perl scripts? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Yury Don Sent: 18 August 2000 15:07 To: [EMAIL PROTECTED] Subject: Re: [SQL] sequences in functions Hello Graham, Friday, August 18, 2000, 6:24:15 PM, you

Re: [SQL] sequences in functions

2000-08-18 Thread Yury Don
Hello Graham, Friday, August 18, 2000, 6:24:15 PM, you wrote: GV> I am having problems referencing sequeces in a function, I think because of GV> the '' characters. The function I am creating is a follows: - GV> CREATE FUNCTION InsertClient ( varchar, varchar, varchar, varchar, varchar, GV> var

[SQL] sequences in functions

2000-08-18 Thread Graham Vickrage
I am having problems referencing sequeces in a function, I think because of the '' characters. The function I am creating is a follows: - CREATE FUNCTION InsertClient ( varchar, varchar, varchar, varchar, varchar, varchar ) RETURNS int4 AS ' DECLARE id INT; BEGIN SELECT nextval('c

[SQL] Sequences do not obey transactions...

2000-06-20 Thread Ryan Kirkpatrick
Either I am missing something or I found a bug in PostgreSQL. Hopefully it is the former. :) Simply, I am trying to use a sequence to generate unique id numbers for a table. Now, a number of the fields in this table have 'check constraints'. What happens, is if I attempt to insert