Re: last comma inside "CREATE TABLE ()" statements
От | GH |
---|---|
Тема | Re: last comma inside "CREATE TABLE ()" statements |
Дата | |
Msg-id | 20010422141602.A81180@over-yonder.net обсуждение исходный текст |
Ответ на | Re: last comma inside "CREATE TABLE ()" statements ("Oliver Elphick" <olly@lfix.co.uk>) |
Список | pgsql-general |
On Sun, Apr 22, 2001 at 07:44:46PM +0100, some SMTP stream spewed forth: > Tom Lane wrote: > >Louis-David Mitterrand <vindex@apartia.ch> writes: > >> Is it against the SQL standard to accept a trailing comma in a table > >> declaration? > > > >Yes ... > > > >> CREATE TABLE "currency" ( > >> currency_id varchar(3), > >> rate float, <-------------------- BOOM! parse error > >> ); > > > >> As in perl, it would make life easier to simply ignore/accept a trailing > >> comma on table declarations. > > > >... however, this seems like a reasonable idea that would not introduce > >any major problems. I have no objections, if someone wants to submit > >a grammar patch. I can think of no place where this would be even remotely useful. Is it really that difficult to remove a comma? If it works now for *all* users of PostgreSQL, why should we change it? gh > > I suppose it isn't a major problem, but enforcing strict grammar > helps to show up inadvertent errors. Suppose I have a set of schema > building files for a whole system; the way I do things, there may be fifty > or more files, one per table. If one of these gets corrupted in editing > (perhaps a line gets deleted by mistake) it would be nice to know about it > through a parser error. Of course, an error may be such that the parser > won't detect it, but why remove protection by gratuitously departing from > the standard? > > -- > Oliver Elphick Oliver.Elphick@lfix.co.uk > Isle of Wight http://www.lfix.co.uk/oliver > PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 > GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C > ======================================== > "If my people, which are called by my name, shall > humble themselves, and pray, and seek my face, and > turn from their wicked ways; then will I hear from > heaven, and will forgive their sin, and will heal > their land." II Chronicles 7:14 > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html
В списке pgsql-general по дате отправления: