473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Insert question null/not null serial, etc.

I downloaded the port for Postgres for PHP-NUKE.

All insert statements are as follows:

For table:
Table "nuke_referer"
Column | Type | Modifiers
--------+------------------------+----------------------------------------------------------
rid | integer | not null default
nextval('"nuke_referer_rid_seq"'::text)
url | character varying(100) | not null default ''
Primary key: nuke_referer_pkey
insert into nuke_referer values (NULL,'whatever');

Which gives me the error: "Warning: pg_exec(): Query failed: ERROR:
ExecAppend: Fail to add null value in not null attribute rid"

Since nowhere in the 3000 files of PHP-Nuke do they actually name columns
for insert commands, does anyone have any suggestions? Can NULL be
replaced with anything? (Keep in mind I'd like something I can globally
change, naming tables/columns individually is out of the question.)
--
[ Russ Schneider (a.k.a. Sugapablo) ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ su*******@12jabber.com <--jabber IM ]

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

http://archives.postgresql.org

Nov 22 '05 #1
2 2452
On Sat, Jan 31, 2004 at 04:56:58PM -0500, Russ Schneider wrote:
insert into nuke_referer values (NULL,'whatever');

Which gives me the error: "Warning: pg_exec(): Query failed: ERROR:
ExecAppend: Fail to add null value in not null attribute rid"

Since nowhere in the 3000 files of PHP-Nuke do they actually name columns
for insert commands, does anyone have any suggestions? Can NULL be
replaced with anything?


Try DEFAULT. It will work on some cases if the NULL value was intended
to insert the default value, but will of course fail otherwise.

I wonder how much confidence you do have on a "port to Postgres" that
doesn't even actually work. You'll probably have lots of more work to
do to make it run, let alone be efficient.

Also, hasn't PHP Nuke had lots of security problems? Somebody else may
be able to suggest a better alternative ...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Find a bug in a program, and fix it, and the program will work today.
Show the program how to find and fix a bug, and the program
will work forever" (Oliver Silfridge)

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

http://archives.postgresql.org

Nov 22 '05 #2
Russ Schneider <ru**@sugapablo.com> writes:
insert into nuke_referer values (NULL,'whatever'); Which gives me the error: "Warning: pg_exec(): Query failed: ERROR:
ExecAppend: Fail to add null value in not null attribute rid"
Sounds like they are expecting NULL to get replaced with the column
default, which is shall we say a rather surprising reading of the SQL
spec (and yeah, I know which other database acts that way).
Since nowhere in the 3000 files of PHP-Nuke do they actually name columns
for insert commands, does anyone have any suggestions? Can NULL be
replaced with anything?


In the last PG release or two you could write DEFAULT instead of NULL
and get the desired behavior.

regards, tom lane

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

http://archives.postgresql.org

Nov 22 '05 #3

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

Similar topics

1
by: t_pet422 | last post by:
Hi, I've got a table in PostgreSql 7.3.2 that has a serial column as a primary key. I want to insert data into the table (inserting values for everything EXCEPT the serial column) and at the...
4
by: Duffey, Kevin | last post by:
I don't know if jdbc/java code requires this, but when I use two gui admin tools I found, and I insert a row into the table using their row editor feature, both require me to enter a number for the...
0
by: Eustice Scrubb | last post by:
In line coding problem. Here's my code: <script language="VB" runat="server"> Dim myConnection As SqlConnection Sub Page_Load(Src As Object, e As EventArgs) ' Create a connection to the SQL...
11
by: Sezai YILMAZ | last post by:
Hello I need high throughput while inserting into PostgreSQL. Because of that I did some PostgreSQL insert performance tests. ------------------------------------------------------------ --...
5
by: Florence HENRY | last post by:
Hello, well, almost everything is in the subject ! I have to fill 2 tables (more complicated than in the example !): CREATE TABLE A ( id serial primary key, foo text);
3
by: Björn Platzen | last post by:
Hello list, I'm a postgres-newbie with a maybe silly question. I'm working on a SuSE-Linux 9.1 with PostgreSQL 7.4.6 with PostGIS 0.9. My problem is, that I can't insert data into a table...
5
by: Stephen D Cook | last post by:
I'm trying to clear a form after the user clicks the Insert button so the textboxes are empty and the checkboxes are unchecked. When I try to put the code in the Click part of the Insert button, I...
2
by: mivey4 | last post by:
Okay I have 2 tables: Table A - holds a list of new hardware serial numbers and their corresponding model (no constraints or indexes) Table B - holds a distinct list of current serial numbers...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.