?
Solved

insert problem with php PgAdmin

Posted on 2006-05-18
7
Medium Priority
?
1,047 Views
Last Modified: 2012-05-05
Hello, I've tried to insert some values into PostgresSQL table with PHP PgAdmin and I got Error message: ERROR:  relation "public.email_eid_seq" does not exist
SQL statement is   INSERT INTO "email" ("EID", "EMAIL", "STATUS") VALUES (nextval('public.email_EID_seq'::text), 'aaaa@xxx.com', 'a').

I am almost new to Postgres and PHP PgAdmin and I could not figure what is wrong.  Needs help....

portal123
0
Comment
Question by:portal123
  • 3
  • 3
7 Comments
 

Author Comment

by:portal123
ID: 16715647
This is what I 've done in PHP PgAdmin
create database and put 'email' as database name and choose encoding and click "create".
create table Name: email, Num of columns:3, options: no checked  on "without OIDS", Comment N/A, then clicked "NEXT".
set columns, data type like follows:
column      Type                       Length       Not Null        Unique Key       Primary key                   Default                                                Comment
EID           integer                       N/A             checked         checked           checked              nextval('public.email_EID_seg':::text)             N/A                        
EMAIL      character varying          50                                                                                                                                                                  
STATUS     character varying         50  
 
Finally,  SQL insert  statement in my 1st question   causes Error message like   relation "public.email_eid_seq" does not exist
.                                                                                                                                                                                                
0
 
LVL 62

Expert Comment

by:gheist
ID: 16715793
And that relation used for default value really does not exist. Error message is appropriate.
0
 
LVL 62

Expert Comment

by:gheist
ID: 16715795
WTF is "php PgAdmin" ???
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 

Author Comment

by:portal123
ID: 16715935
Yes, I use php pgadmin as WTF. If I insert some values, I expect  'EID' to be like playing a primary key's role in auto increment in MYSQL database.
0
 
LVL 62

Assisted Solution

by:gheist
gheist earned 1000 total points
ID: 16716125
0
 
LVL 22

Accepted Solution

by:
earth man2 earned 1000 total points
ID: 16717090
INSERT INTO "email" ("EID", "EMAIL", "STATUS") VALUES (nextval("'public.email_EID_seq"'), 'aaaa@xxx.com', 'a')

You probably need to add double quotes in the name of the sequence because you are using mixed case names.
TIP DON'T USE MiXeD CasE naMEs IT REALLY MakEs iT mOrE diFFIcuLt to PROGRam.
0
 

Author Comment

by:portal123
ID: 16717474
Thanks a lot.... both guys...!!.

-------------   portal123   ------------------------------
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: http://www.postgresql.org/ (http://www.postgresql.org/) This requires some add-o…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question