Re: inserting values like in mySQL

From: Chris Smith <csmith(at)squiz(dot)net>
To: Nabil Sayegh <nsmail(at)sayegh(dot)de>, postgresql <pgsql-novice(at)postgresql(dot)org>
Subject: Re: inserting values like in mySQL
Date: 2001-05-22 22:51:10
Message-ID: 4.3.2.7.2.20010523084857.00e61380@cooee.cybersydney.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

> > 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 in this context

Huh? Mysql doesn't like it either (at least in 3.23). Anyway, it's not
standard.

>P.S.S.: Perhaps also in the GROUP BY context :)

Can't comment on this one, have no idea what you're talking about.

----------------------
Chris Smith
http://www.squiz.net/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Chris Smith 2001-05-22 23:24:02 Re: inserting values like in mySQL
Previous Message Chris Smith 2001-05-22 22:34:13 Re: inserting values like in mySQL