pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: emils@mail.grafton.lv
Subject: default value syntax - pg compared to?
Date: Mon, 12 Mar 2001 15:46:26 -0200
Message-ID: <200103121746.PAA04265@home.grafton.lv> (raw)

Hello,

do you happen to know, if there is any sqlserver that WON'T handle 
inserting default value if it is not specified in the INSERT field list? I
am particularly interested in ORACLE, INFORMIX and MYSQL .

Eg.

CREATE TABLE test
(
 id integer default 5,
 fld1 text
);

INSERT INTO test (fld1) VALUES ('blahblah');

So, is there any sqlserver that under these conditions will NOT 
make id = 5 for the inserted row?

Background:
There is a package called  phprojekt where the developer has 
created some workarounds for different handlings of auto-
incrementing fields (sequences) for the above databases.

The only place he uses them, however, is in the INSERT 
stataments (and he does not need to know the new id value for the 
inserted row). 

So I suggested he rewrite INSERTs explicitly specifying field 
names and excluding the id field, rather than putting a server-
specific "default value" token (which postgres does not support 
anyway). Will it work for the above other dbs?

TIA for answers!

Emils



view thread (4+ messages)  latest in thread

Message-ID: <200103121746.PAA04265@home.grafton.lv>
Permalink:  ../200103121746.PAA04265@home.grafton.lv/
Also on:    postgresql.org/message-id/200103121746.PAA04265@home.grafton.lv

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: emils@mail.grafton.lv
  Subject: Re: default value syntax - pg compared to?
  In-Reply-To: <200103121746.PAA04265@home.grafton.lv>
  References: <200103121746.PAA04265@home.grafton.lv>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox