Re: Basic DOMAIN Support

From: "Rod Taylor" <rbt(at)zort(dot)ca>
To: "Neil Conway" <nconway(at)klamath(dot)dyndns(dot)org>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "PostgreSQL Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Basic DOMAIN Support
Date: 2002-03-08 01:40:04
Message-ID: 089301c1c642$72e647c0$b002000a@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Sorry for making this a painful process. pg_depend will be alot
better :) -- chalk it up to a learning experience I suppose.

Bruce: Docs and regress queries still apply.

Anyway, dug out a FreeBSD machine and tested this round on it. No
compile errors or warnings (not from my parts anyway), bison was quite
(see below), and regression tests ran perfectly.

My win2k cygwin environment still has a ton of regress errors
(postmaster crashes mostly)...

> > The shift / reduce problem was fixed by simply removing the
ability to
> > make types with complex defaults (reverted back to old simple
> > methods).
>
> I still see a shift / reduce conflict in gram.y

The primary issue is that I want to do an " '=' c_expr " (through a
couple of steps) for the type default.

I've tried several things to get rid of it, but nothing works -- and I
want an expression (closer to SQL 99 Create Type). Without the '='
between DEFAULT and c_expr everything is fine -- of course that could
break applications that use CREATE TYPE.

Anyway, I copped out and added a %expect 1. I think this is close
enough to the infamous 'if / else' scenario with expressions that it's
warrented (the reason they came up with it).

Perhaps it could be opt_equal and drop the equal sign in 7.4 or
something to remove the conflict entirely?

For the errors, I just realized that if I redirect output to a log
file I'm left with only warnings and errors. Is there a website with
these kinds of tricks listed?

> > I don't see any of the compile warnings other were receiving
though.
>
> make[3]: Entering directory
`/home/nconway/pgsql/src/backend/catalog'
> gcc-3.0 -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
> -I../../../src/include -c -o heap.o heap.c
> heap.c: In function `cookDefault':
> heap.c:1904: warning: implicit declaration of function `getBaseType'

header included.

> make[3]: Entering directory `/home/nconway/pgsql/src/backend/parser'
> gcc-3.0 -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
> -I../../../src/include -c -o analyze.o analyze.c
> gcc-3.0 -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
> -I../../../src/include -c -o gram.o gram.c
> gram.y: In function `yyparse':
> gram.y:3228: warning: assignment from incompatible pointer type
> gram.y:3232: warning: assignment from incompatible pointer type

Your line numbers are slightly different but I believe they're CREATE
DATABASE WITH OWNER issues.

> gcc-3.0 -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
> -I../../../src/include -c -o parse_coerce.o parse_coerce.c
> parse_coerce.c:637:1: warning: no newline at end of file

Umm... Is this a gcc 3 thing? Either way, line added -- but I still
think thats a silly thing to complain about. I didn't realize
compilers cared about whitespace -- aside from Python anyway.

> make[3]: Entering directory `/home/nconway/pgsql/src/backend/nodes'
> gcc-3.0 -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
> -I../../../src/include -c -o copyfuncs.o copyfuncs.c
> copyfuncs.c:2232: warning: `_copyCreateDomainStmt' defined but not
used

Commented out, but left in for potential use.

Attachment Content-Type Size
domain.patch application/octet-stream 110.2 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-03-08 02:42:36 Re: Basic DOMAIN Support
Previous Message Bruce Momjian 2002-03-08 01:27:04 Re: [PATCHES] system catalog relation of a table and a serial