473,811 Members | 2,982 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pgadmin 3

In pgadmin3 I'm tring to add auto_inc column like this

ALTER TABLE public.modems ADD COLUMN id serial;

But get this error :

NOTICE: ALTER TABLE will create implicit sequence "modems_id_ seq" for "serial" column "modems.id"

ERROR: adding columns with defaults is not implemented
HINT: Add the column, then use ALTER TABLE SET DEFAULT.
How to add auto_inc fields... thanx

PS. Can I use OID column for primary/foreign functionality, or it
has some restriction ...i mean i may not use auto_inc field ?

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

Nov 23 '05 #1
2 2690
Hello,
try alter table modems add column id serial set default

Set default tells postgres to automatically fill in the column data using a sequence on your behalf.

OID could be used for primary key I suppose. To use as a foreign key you would manually have to somehow copy the value in table A and insert into B. AFAIK system generated OIDS are unique to each table.

HTH

mike
In pgadmin3 I'm tring to add auto_inc column like this

ALTER TABLE public.modems ADD COLUMN id serial;

But get this error :

NOTICE: ALTER TABLE will create implicit sequence "modems_id_ seq" for "serial" column "modems.id"

ERROR: adding columns with defaults is not implemented
HINT: Add the column, then use ALTER TABLE SET DEFAULT.
How to add auto_inc fields... thanx

PS. Can I use OID column for primary/foreign functionality, or it
has some restriction ...i mean i may not use auto_inc field ?

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


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

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2
On Wed, Jul 21, 2004 at 12:06:09AM -0500, Mike G wrote:
OID could be used for primary key I suppose. To use as a foreign key
you would manually have to somehow copy the value in table A and
insert into B. AFAIK system generated OIDS are unique to each table.
WRONG. OIDs are not guarenteed unique. They are not suitable for
primary keys. They will wrap eventually. They are not indexed in any
way unless you create an index yourself.

Use serials from primary keys, much safer...
--
Martijn van Oosterhout <kl*****@svana. org> http://svana.org/kleptog/ Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFA/wkkY5Twig3Ge+YR Api7AJ9PmHl6mYq XHeULgPGFT+vzj3 3+WgCeMwUF
d7Y6WNiCg09LHGw K8MsuaIk=
=yR+m
-----END PGP SIGNATURE-----

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1193
by: Matthew T. O'Connor | last post by:
Saw this on newsforge.com just a few minutes ago. Go to www.pgadmin.org to get your copy. I just installed the windows version on a Win2k Terminal Server Box that several developers use, installed easy seems to work well, and looks nice. Contratualatios to all the PGAdmin developers on a job well done, finally a nice cross-platform gui postgresql admin tool!!! Matthew
1
2262
by: Együd Csaba | last post by:
Hi All, I've a problem using PGAdmin III. When I click on one of my functions the definition pane shows an empty function (with the correct header and footer but with no body). Pg_dump shows everything correctly. What can be the problem. My other problem is that PGAdmin won't handle '?' (euro) sign. It shows the previously correctly enterd data (by means of other tools) but it won't insert or update it in the correct way. It shows a '?'...
1
6644
by: mikew | last post by:
I am working at a company that has been using MS SQL Server, and we are going to be switching over to postgresql next week. (Getting off of Windows will be a relief!) I am very familiar with SQL Server's "Enterprise Manager", which is their GUI for accessing the db. I have been acquainting myself with pgAdmin. There are a number of things that I really like about pgAdmin, but there are a few things that SQL Server Enterprise manager can...
1
3425
by: MargaretGillon | last post by:
I am using PGADMIN III v1.1.0 Windows to set up PostgreSQL tables on a Linux Server, RedHat 9. Every time I create a character field, even just one character wide, the PGADMIN uses EXTENDED as the default storage type. Is this normal? I can't find anything about why this would be done in the PostgreSQL documentation or the Internet. It seems to me it will be very messy if every character field is in a secondary table. I would have thought...
2
1942
by: mmd | last post by:
I want to use pgadmin to set up some tables, rather than do all the psql statements from the terminal. When I try to add a server, though, pgadmin fails to connect, and asks whether the server is accepting TCP/IP connections on the default port, and whether localhost is the correct servername. I assume that both of these ARE set to the defaults, because if I simply type
1
1527
by: raptor | last post by:
hi, Is there a plans for pgadmin III to support editing the table data, not only view-ing it ? tia ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
2
2179
by: Vic Cekvenich | last post by:
What can I run on OS X as a pgAdmin equivalment (other than the Java solutions)? ..V -- Please post on Rich Internet Applications User Interface (RiA/SoA) <http://www.portalvu.com> ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings
0
1218
by: Laurent Duperval | last post by:
HI, I'm using pgadmin III 1.2.0 Post Beta 1 (Sept 17 2004). I used it to execute a SQL script that creates tables and inserts data. At the end, I get a message saying that everything went through correctly. However, when I try to view the data in the pgadmin window, nothing shows up. My backend is PG 8.0 Beta 2 on Windows 2000. Any ideas on what the problem could be?
1
7215
by: John French | last post by:
I just installed postgresql 7.4.5 and pgadmin3 1.0.2 on FreeBSD and noticed that pgadmin allows the pgsql user to log in while ignoring the password. You can enter a wrong password or no password and still get into postgresql. I started the postmaster as a FreeBSD user named pgsql by running postmaster -i -D /usr/local/pgsql/data I changed postgresql's pgsql user account to have a new password via pgadmin3 too. But I can still log in to...
1
124920
by: gocraig | last post by:
PG Admin Version 1.6.0 (Nov 15 2006, rev 5641) Running on Windows 2000 PostgreSQL 8.2.6, running remotely on Linux pg_hba.conf contains the record ... host all all 12.345.678.90 255.255.255.255 trust where 12.345.678.90 is the IP address that I am trying to connect from Database started with /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -o -i start
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10395
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9211
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5564
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4352
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3876
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.