Skip site navigation (1) Skip section navigation (2)

Re: inserting values like in mySQL

From: Nabil Sayegh <imap(at)sayegh(dot)de>
To: Peter Asemann <Peter(dot)Asemann(at)rrze(dot)uni-erlangen(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: inserting values like in mySQL
Date: 2001-05-22 21:51:24
Message-ID: 20010522215040.C05C71684342@imap.net-lab.net (view raw or flat)
Thread:
Lists: pgsql-novice
On 18 May 2001 18:03:25 +0200, Peter Asemann wrote:
> In mySQL it was like this:
> 
> insert into users values ('','peter','my_pass');
> 
> In PostGreSQL this does not work. The only thing that works is
> 
> insert into users (name,pass) values ('peter','my_pass');


Yes, thats not nice in postgresql. But there is a workaround.
Put the 'default' fields at the end:

---------------8<---------------------
CREATE TEMP TABLE tempo (test bool, id serial);

INSERT INTO tempo values (true);

SELECT * from tempo;
---------------8<---------------------

 test | id 
------+----
 t    |  1
(1 row)

Hope it helps.

P.S.: I'd really like postgresql to behave like mysql this context
P.S.S.: Perhaps also in the GROUP BY context :)

--
 Nabil Sayegh



In response to

pgsql-novice by date

Next:From: Nabil SayeghDate: 2001-05-22 21:53:15
Subject: Re: inserting values like in mySQL
Previous:From: ffrtDate: 2001-05-22 18:45:01
Subject: PostgreSQL and programming languages

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group