Posts Tagged ‘sequence’

Tips N’ Tricks - setting field based on order

2008-10-30 17:50:25 CET | 2 Comments | Tags: , , ,

Let’s imagine following situation:

create table test (id int4 primary key, priority int4);
insert into test (id)
select distinct (random() * 100000000)::int4 from generate_series(1,1000);

Table test will now contain some (up to 1000) records, with random ids.

Now, we want to update first 3 records (ordered by id) to have following values in priority:

  1. 10000
  2. 5000
  3. 1000

- MORE -

Waiting for 8.4 - sequence details

2008-07-30 15:17:20 CEST | 1 Comment | Tags: , , ,

On 15th of July, Bruce Momjian commited patch written by Dickson S. Guedes, which:

Have psql \d show the value of sequence columns.

- MORE -

Waiting for 8.4 - partial-match support in GIN, and sequence restart

2008-05-17 17:20:36 CEST | 1 Comment | Tags: , , , , , , ,

Today we have two interesting patches:

  • patch by Teodor Sigaev and Oleg Bartunov, and committed by Tom Lane, which adds interesting capability to GIN indexes
  • patch by Zoltan Boszormenyi, also committed by Tom, which adds “RESTART” option to ALTER SEQUENCE. With some interesting consequences

- MORE -