Fwd: PostgreSQL Statement Dependency Resolving | Schema Upgrade

2021-02-28 Thread Jagmohan Kaintura
-- Forwarded message -
From: Jagmohan Kaintura 
Date: Mon, Feb 22, 2021 at 7:44 AM
Subject: PostgreSQL Statement Dependency Resolving | Schema Upgrade
To: 


Hi Team,

WHile performing a schema upgrade which needs any alter in the definition
of schema object, it always asks to execute that statement with CASCADE as
it has many dependent objects on it.

Most of the time we have to drop a lot of entities to just compile a simple
view.

In out case :
Views are being referenced by many other schema objects , in procedures,
functions and views.


Do we have any PostgreSQL extension or any standardized method which can
help with capturing all the cascade objects before dropping them and then
reloading once the new definition is applied.

-- 
*Best Regards,*
Jagmohan
Senior Consultant, TecoreLabs.


-- 
*Best Regards,*
Jagmohan
Senior Consultant, TecoreLabs.


Problem building psql on Mac OS 10.15 (around readline bit I think)

2021-02-28 Thread Ben Madin
G'day all,

I am trying to build PostgreSQL 13.2 on Mac OS X 10.15.7. I was about to
build 13.1 on the same 10.15 (but probably not 10.15.7) about 8 weeks ago
without problems, so I was a bit surprised to find this error happening.

The error comes up as:

gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Werror=vla -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument -O2 -I. -I.
-I../../../src/interfaces/libpq -I../../../src/include  -isysroot
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
 -I/usr/local/include/libxml2  -I/usr/local/ssl/include  -c -o input.o
input.c
*input.c:82:3: error: implicit declaration of function
'rl_reset_screen_size' is invalid in C99*
  [-Werror,-Wimplicit-function-declaration]
rl_reset_screen_size();
^
input.c:82:3: note: did you mean 'rl_set_screen_size'?
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/readline/history.h:198:8:
note:
  'rl_set_screen_size' declared here
void rl_set_screen_size(int, int);
 ^

*input.c:455:13: error: implicit declaration of function 'append_history'
is invalid in C99*  [-Werror,-Wimplicit-function-declaration]
errnum = append_history(nlines, fname);
 ^
input.c:455:13: note: did you mean 'pg_append_history'?
input.c:114:1: note: 'pg_append_history' declared here
pg_append_history(const char *s, PQExpBuffer history_buf)
^
2 errors generated.
make[3]: *** [input.o] Error 1
make[2]: *** [all-psql-recurse] Error 2
make[1]: *** [all-bin-recurse] Error 2
make: *** [all-src-recurse] Error 2


I'm not sure that rl_set_screen_size is a good replacement for reset, and I
realise that this might be about the apple readline libs... do I need to
install another version of readline, or is there somewhere else I should be
looking? )and can I assume given the proximity of the second error, that it
might be a readline upgrade again?

cheers

Ben


-- 

[image: Ausvet Logo] 

Dr Ben Madin

BVMS MVPHMgmt PhD MANZCVS GAICD
Managing Director
Mobile:
+61 448 887 220 <+61448887220>
E-mail:
b...@ausvet.com.au
Website:
www.ausvet.com.au
Skype: benmadin
Address:
5 Shuffrey Street
Fremantle, WA 6160
Australia


Re: Problem building psql on Mac OS 10.15 (around readline bit I think)

2021-02-28 Thread Tom Lane
Ben Madin  writes:
> I am trying to build PostgreSQL 13.2 on Mac OS X 10.15.7. I was about to
> build 13.1 on the same 10.15 (but probably not 10.15.7) about 8 weeks ago
> without problems, so I was a bit surprised to find this error happening.
>
> *input.c:82:3: error: implicit declaration of function
> 'rl_reset_screen_size' is invalid in C99*
>   [-Werror,-Wimplicit-function-declaration]
> rl_reset_screen_size();
> ^
> input.c:82:3: note: did you mean 'rl_set_screen_size'?
> /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/readline/history.h:198:8:
> note:
>   'rl_set_screen_size' declared here
> void rl_set_screen_size(int, int);
>  ^

That's odd.  Did you update Xcode or Apple's "command line tools" since
your last successful PG build?  Do you have either MacPorts or Homebrew
stuff on this machine?

FWIW, I don't think we've changed anything in this immediate area in
quite some time.  So I guess something in your environment changed,
but it's not clear what.

regards, tom lane




Re: Problem building psql on Mac OS 10.15 (around readline bit I think)

2021-02-28 Thread Ben Madin
Hi Tom,

thanks for such a quick reply - there's the rub, I really can't think of
anything other than apple point updates.

I checked the configure output, and it noted that neither of those
functions were available (but didn't appear to change anything or not try
building)

I then installed readline-8.1, and added:

./configure --prefix=/usr/local/pgsql-${PG_VERSION}
--with-extra-version=-bm \
--with-bonjour --with-uuid=e2fs \
--with-libxml --with-libxslt \
--with-python
PYTHON=/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 \
--with-system-tzdata=/usr/share/zoneinfo \
--with-openssl \
--with-libraries=/usr/local/ssl/lib:/usr/local/lib \
--with-includes=/usr/local/ssl/include:/usr/local/include/readline

to the configure, and the configure output now showed both available,

checking for rl_reset_screen_size... yes
checking for append_history... yes

and it shows

configure: using CPPFLAGS=-isysroot $(PG_SYSROOT)
 -I/usr/local/include/libxml2  -I/usr/local/ssl/include
-I/usr/local/include/readline
configure: using LDFLAGS=-isysroot $(PG_SYSROOT)  -L/usr/local/lib
 -L/usr/local/ssl/lib -Wl,-dead_strip_dylibs

at the bottom of the configure output but the build script still failed at
the same point showing the same error citing the readline/history.h from
the apple SDK's... is there something else I have to do to ensure it uses
the ones on the PATH and specified in the configure?

cheers

Ben


On Mon, 1 Mar 2021 at 12:50, Tom Lane  wrote:

> Ben Madin  writes:
> > I am trying to build PostgreSQL 13.2 on Mac OS X 10.15.7. I was about to
> > build 13.1 on the same 10.15 (but probably not 10.15.7) about 8 weeks ago
> > without problems, so I was a bit surprised to find this error happening.
> >
> > *input.c:82:3: error: implicit declaration of function
> > 'rl_reset_screen_size' is invalid in C99*
> >   [-Werror,-Wimplicit-function-declaration]
> > rl_reset_screen_size();
> > ^
> > input.c:82:3: note: did you mean 'rl_set_screen_size'?
> >
> /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/readline/history.h:198:8:
> > note:
> >   'rl_set_screen_size' declared here
> > void rl_set_screen_size(int, int);
> >  ^
>
> That's odd.  Did you update Xcode or Apple's "command line tools" since
> your last successful PG build?  Do you have either MacPorts or Homebrew
> stuff on this machine?
>
> FWIW, I don't think we've changed anything in this immediate area in
> quite some time.  So I guess something in your environment changed,
> but it's not clear what.
>
> regards, tom lane
>


-- 

[image: Ausvet Logo] 

Dr Ben Madin

BVMS MVPHMgmt PhD MANZCVS GAICD
Managing Director
Mobile:
+61 448 887 220 <+61448887220>
E-mail:
b...@ausvet.com.au
Website:
www.ausvet.com.au
Skype: benmadin
Address:
5 Shuffrey Street
Fremantle, WA 6160
Australia