Re: Basic DOMAIN Support - Mailing list pgsql-patches

From Rod Taylor
Subject Re: Basic DOMAIN Support
Date
Msg-id 089301c1c642$72e647c0$b002000a@jester
Whole thread Raw
In response to Re: Basic DOMAIN Support  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Basic DOMAIN Support
Re: Basic DOMAIN Support
List 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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: system catalog relation of a table and a serial sequence
Next
From: Tom Lane
Date:
Subject: Re: Basic DOMAIN Support