Unix Technical Forum

PG Admin

This is a discussion on PG Admin within the Pgsql General forums, part of the PostgreSQL category; --> I just installed PostgreSQL 8.1 and PG Admin 1.6.1 . These versions have a sequential column, that is not ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 12:39 PM
Bob Pawley
 
Posts: n/a
Default PG Admin

I just installed PostgreSQL 8.1 and PG Admin 1.6.1 .

These versions have a sequential column, that is not part of the table, identifying the rows.

Is there any method of accessing those numbers and identifying them with elements within the table??

Bob Pawley
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 12:39 PM
Richard Huxton
 
Posts: n/a
Default Re: PG Admin

Bob Pawley wrote:
> I just installed PostgreSQL 8.1 and PG Admin 1.6.1 .
>
> These versions have a sequential column, that is not part of the
> table, identifying the rows.
>
> Is there any method of accessing those numbers and identifying them
> with elements within the table??


Are you sure it's not just numbering the rows as it displays them?

--
Richard Huxton
Archonet Ltd

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 12:39 PM
Bob Pawley
 
Posts: n/a
Default Re: PG Admin

That's what they are doing.

That is also what I am looking for, if it is accessable. If so, I can use
that information to add a sequential numerical element to my information
that doesn't have the restrictions of a serial column.

Bob
----- Original Message -----
From: "Richard Huxton" <dev@archonet.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Postgresql" <pgsql-general@postgresql.org>
Sent: Monday, December 04, 2006 9:39 AM
Subject: Re: [GENERAL] PG Admin


> Bob Pawley wrote:
>> I just installed PostgreSQL 8.1 and PG Admin 1.6.1 .
>>
>> These versions have a sequential column, that is not part of the
>> table, identifying the rows.
>>
>> Is there any method of accessing those numbers and identifying them
>> with elements within the table??

>
> Are you sure it's not just numbering the rows as it displays them?
>
> --
> Richard Huxton
> Archonet Ltd
>



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 12:39 PM
Tony Caduto
 
Posts: n/a
Default Re: PG Admin

Bob Pawley wrote:
> That's what they are doing.
>
> That is also what I am looking for, if it is accessable. If so, I can
> use that information to add a sequential numerical element to my
> information that doesn't have the restrictions of a serial column.
>
> Bob
>

Hi Bob,

Well, if you create your tables WITH OIDs then each row has a OID
associated with it.

What exactly are the restrictions of a serial column? It's just
standard integer value with a default value that calls the nextval function.

Later,

--
Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best bet for Postgresql Administration


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 12:39 PM
Bob Pawley
 
Posts: n/a
Default Re: PG Admin

When a row is deleted the serial number and oid are also deleted. The
sequence then has gaps which are inadmissible.

Bob
----- Original Message -----
From: "Tony Caduto" <tony_caduto@amsoftwaredesign.com>
To: "Bob Pawley" <rjpawley@shaw.ca>; <pgsql-general@postgresql.org>
Sent: Monday, December 04, 2006 10:43 AM
Subject: Re: [GENERAL] PG Admin


> Bob Pawley wrote:
>> That's what they are doing.
>>
>> That is also what I am looking for, if it is accessable. If so, I can use
>> that information to add a sequential numerical element to my information
>> that doesn't have the restrictions of a serial column.
>>
>> Bob
>>

> Hi Bob,
>
> Well, if you create your tables WITH OIDs then each row has a OID
> associated with it.
>
> What exactly are the restrictions of a serial column? It's just standard
> integer value with a default value that calls the nextval function.
>
> Later,
>
> --
> Tony Caduto
> AM Software Design
> http://www.amsoftwaredesign.com
> Home of PG Lightning Admin for Postgresql
> Your best bet for Postgresql Administration
>
> ---------------------------(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
>



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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 12:40 PM
Raymond O'Donnell
 
Posts: n/a
Default Re: PG Admin

On 4 Dec 2006 at 15:40, Bob Pawley wrote:

> When a row is deleted the serial number and oid are also deleted. The
> sequence then has gaps which are inadmissible.


This is an issue which has come up at various times on this list in
the past - it may be worth having a look through the archives. Here's
one recent thread:

http://archives.postgresql.org/pgsql...8/msg00535.php


--Ray.


----------------------------------------------------------------------

Raymond O'Donnell
Director of Music, Galway Cathedral, Galway, Ireland
rod@iol.ie
----------------------------------------------------------------------



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-09-2008, 12:40 PM
Scott Marlowe
 
Posts: n/a
Default Re: PG Admin

On Mon, 2006-12-04 at 17:53, Raymond O'Donnell wrote:
> On 4 Dec 2006 at 15:40, Bob Pawley wrote:
>
> > When a row is deleted the serial number and oid are also deleted. The
> > sequence then has gaps which are inadmissible.

>
> This is an issue which has come up at various times on this list in
> the past - it may be worth having a look through the archives. Here's
> one recent thread:
>
> http://archives.postgresql.org/pgsql...8/msg00535.php


Yeah. The requirement for no gaps is a real no starter for any kind of
large data set.

Imagine modelling all the people in the US. 350 million entries. No
big deal. I can create that in minutes.

You each one give a number. Again, no big deal. A couple of minutes.

For everyone that dies, you remove the name. No big deal. a couple
seconds to run a delete.

For every one that is born, you add it to the list, giving it the next
number. again, no big deal. My workstation could probably handle the
load.

Now, turn that on its head. Every time you delete someone, you have to
renumber the data set, and for everyone added you have to make sure
there are no gaps.

Suddenly, you've got a problem that could bring even big iron to its
knees. All because some buearocrat (sp) hadn't the imagination to think
of non-sequential numbering systems.

While there are occasional systems where it is reasonable to actually
have no sequential gaps, most of the time the only justification is "I
don't like them." If that is the case, you should rethink your design.
If you're stuck with them because of some idiotic rule from on high,
then at least abstract the numbers to some degree to improve performance
and keep you from having to update about half of an entire table several
times a minute.

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

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-09-2008, 12:40 PM
Bob Pawley
 
Posts: n/a
Default Re: PG Admin

I'm doing something similar - using a control table, dropping and creating
the serial column and updating in a manner that does the job.

It works - barely. I am seeking a more elegent and stable method. Having a
simple update recognizing the row numbers (in version 1.6.1) would be
better - perhaps.

Bob


----- Original Message -----
From: "Raymond O'Donnell" <rod@iol.ie>
To: <pgsql-general@postgresql.org>
Sent: Monday, December 04, 2006 3:53 PM
Subject: Re: [GENERAL] PG Admin


> On 4 Dec 2006 at 15:40, Bob Pawley wrote:
>
>> When a row is deleted the serial number and oid are also deleted. The
>> sequence then has gaps which are inadmissible.

>
> This is an issue which has come up at various times on this list in
> the past - it may be worth having a look through the archives. Here's
> one recent thread:
>
> http://archives.postgresql.org/pgsql...8/msg00535.php
>
>
> --Ray.
>
>
> ----------------------------------------------------------------------
>
> Raymond O'Donnell
> Director of Music, Galway Cathedral, Galway, Ireland
> rod@iol.ie
> ----------------------------------------------------------------------
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>



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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-09-2008, 12:40 PM
Bob Pawley
 
Posts: n/a
Default Re: PG Admin

Your missing the point.

I am creating a design system for industrial control.

The control devices need to be numbered. The numbers need to be sequential.
If the user deletes a device the numbers need to regenerate to again become
sequential and gapless.

Bob
----- Original Message -----
From: "Scott Marlowe" <smarlowe@g2switchworks.com>
To: "Raymond O'Donnell" <rod@iol.ie>
Cc: "pgsql general" <pgsql-general@postgresql.org>
Sent: Monday, December 04, 2006 4:09 PM
Subject: Re: [GENERAL] PG Admin


> On Mon, 2006-12-04 at 17:53, Raymond O'Donnell wrote:
>> On 4 Dec 2006 at 15:40, Bob Pawley wrote:
>>
>> > When a row is deleted the serial number and oid are also deleted. The
>> > sequence then has gaps which are inadmissible.

>>
>> This is an issue which has come up at various times on this list in
>> the past - it may be worth having a look through the archives. Here's
>> one recent thread:
>>
>> http://archives.postgresql.org/pgsql...8/msg00535.php

>
> Yeah. The requirement for no gaps is a real no starter for any kind of
> large data set.
>
> Imagine modelling all the people in the US. 350 million entries. No
> big deal. I can create that in minutes.
>
> You each one give a number. Again, no big deal. A couple of minutes.
>
> For everyone that dies, you remove the name. No big deal. a couple
> seconds to run a delete.
>
> For every one that is born, you add it to the list, giving it the next
> number. again, no big deal. My workstation could probably handle the
> load.
>
> Now, turn that on its head. Every time you delete someone, you have to
> renumber the data set, and for everyone added you have to make sure
> there are no gaps.
>
> Suddenly, you've got a problem that could bring even big iron to its
> knees. All because some buearocrat (sp) hadn't the imagination to think
> of non-sequential numbering systems.
>
> While there are occasional systems where it is reasonable to actually
> have no sequential gaps, most of the time the only justification is "I
> don't like them." If that is the case, you should rethink your design.
> If you're stuck with them because of some idiotic rule from on high,
> then at least abstract the numbers to some degree to improve performance
> and keep you from having to update about half of an entire table several
> times a minute.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>



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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-09-2008, 12:40 PM
Steve Atkins
 
Posts: n/a
Default Re: PG Admin


On Dec 4, 2006, at 3:53 PM, Raymond O'Donnell wrote:

> On 4 Dec 2006 at 15:40, Bob Pawley wrote:
>
>> When a row is deleted the serial number and oid are also deleted. The
>> sequence then has gaps which are inadmissible.

>
> This is an issue which has come up at various times on this list in
> the past - it may be worth having a look through the archives. Here's
> one recent thread:
>
> http://archives.postgresql.org/pgsql...8/msg00535.php


Or, better, http://archives.postgresql.org/pgsql-general/2006-09/
msg00948.php

I'm sure that PG Admin just generates the numbers in the GUI as it
displays them (as they're meaningless as persistent data).

Cheers,
Steve


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:28 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com