Related articles
- Making your servers a bit more "green" with smart system adminstration, part 3: the right tool for the right job
- Fighting spam with greylisting
- One off system backup methods
- Making your servers a bit more "green" with smart system adminstration, part 2: tools
- Logging unconfigured domain names in Apache
Adding sequences in phpPgAdmin
Armijn Hemel,
November 15, 2010,
5849 views.
PostgreSQL is a very powerful database engine. A helpful tool for managing PostgreSQL databases is phpPgAdmin. Although it is a good tool some things are a bit quirky.
Tags: administration, postgresql
One of the differences between MySQL and PostgreSQL is how autoincrements work. In MySQL you use the AUTOINCREMENT keywords, in PostgreSQL you use a sequence.
In phpPgAdmin a sequence is created as follows:
- open the database
- find the right schema you want to add the sequence to (for example public)
- click on the option 'sequences'
- add a sequence
That is the easy part. Adding it to the correct column so I could use it is a bit different. In the interface for phpPgAdmin I searched for a long time for the right option how to use the sequence, but could not find it. The good news is that it is not very difficult at all to use it, you just need to know that you cannot do it in the interface.
For me the solution was simple: use it in the default section for a column, for example:
nextval('id_sequence')
for an integer value.
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License.










