RE: database "cdf_100_1313" does not exist

2019-09-09 Thread Klint Gore
From: nikhil raj [mailto:nikhilraj...@gmail.com] Sent: Tuesday, 10 September 2019 12:39 AM To: Adrian Klaver Cc: Tom Lane; Rob Sargent; Dan Livingston; Karsten Hilbert; pgsql-general@lists.postgresql.org Subject: Re: database "cdf_100_1313" does not exist > DBLIST=/usr/lib/post

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread nikhil raj
t; > issue. Having the issue with the Grant command only its not taking the > > parameters. > > > > /usr/lib/postgresql/11/bin/psql -p 5432 -U postgres -d $DBLIST -c > > "GRANT CONNECT ON DATABASE \"$DBLIST\" TO cpupdate" > > ERROR: database &

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread Daniel Verite
nikhil raj wrote: > /usr/lib/postgresql/11/bin/psql -p 5432 -U postgres -d $DBLIST -c "GRANT > CONNECT ON DATABASE \"$DBLIST\" TO cpupdate" > ERROR: database " CDF_100_1313" does not exist That's because you don't use the unaligned format

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread Adrian Klaver
CT ON DATABASE \"$DBLIST\" TO cpupdate" ERROR:  database " CDF_100_1313" does not exist You are not showing how you are currently generating DBLIST. From the looks of it you have a leading space in the database name: " CDF_100_1313" * * *** For the above one w

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread nikhil raj
/usr/lib/postgresql/11/bin/psql -p 5432 -U postgres -d $DBLIST -c > "GRANT CONNECT ON DATABASE $DBLIST TO cpupdate" > >> ERROR: database "cdf_100_1313" does not exist > > This still isn't quoted properly. It's tricky since double-quote is > speci

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread Tom Lane
> On Sep 9, 2019, at 7:16 AM, nikhil raj wrote: >> /usr/lib/postgresql/11/bin/psql -p 5432 -U postgres -d $DBLIST -c "GRANT >> CONNECT ON DATABASE $DBLIST TO cpupdate" >> ERROR: database "cdf_100_1313" does not exist This still isn't quoted proper

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread Rob Sargent
> On Sep 9, 2019, at 7:16 AM, nikhil raj wrote: > > Hi Dan, > > Still facing the same issue. > > /usr/lib/postgresql/11/bin/psql -p 5432 -U postgres -d $DBLIST -c "GRANT > CONNECT ON DATABASE $DBLIST TO cpupdate" > ERROR: database "cdf_100_13

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread nikhil raj
e: > > Hi Dan, > > Still facing the same issue. > > /usr/lib/postgresql/11/bin/psql -p 5432 -U postgres -d $DBLIST -c "GRANT > CONNECT ON DATABASE $DBLIST TO cpupdate" > ERROR: database "cdf_100_1313" does not exist > > >>>> Can we see the output of psql’s \l ? >

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread Dan Livingston
re I execute it via shell. >> > DBLIST=/usr/lib/postgresql/11/bin/psql -p 5432 -U postgres -d postgres >> -q >> > -t -c "SELECT datname from pg_database where datname in >> > ('CDF_100_1313')"/usr/lib/postgresql/11/bin/psql >> > -p 5432 -U post

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread nikhil raj
Hi Dan, Still facing the same issue. /usr/lib/postgresql/11/bin/psql -p 5432 -U postgres -d $DBLIST -c "GRANT CONNECT ON DATABASE $DBLIST TO cpupdate" ERROR: database "cdf_100_1313" does not exist On Mon, Sep 9, 2019 at 6:38 PM Dan Livingston wrote: > > I think you

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread nikhil raj
n/psql > > -p 5432 -U postgres -d $DBLIST -c "GRANT CONNECT ON DATABASE "$DBLIST" TO > > cpupdate" > > > > ERROR: database "cdf_100_1313" does not exist > > Likely a quoting issue. > > Karsten Hilbert > -- > GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B > > >

Re: database "cdf_100_1313" does not exist

2019-09-09 Thread Karsten Hilbert
tabase where datname in > ('CDF_100_1313')"/usr/lib/postgresql/11/bin/psql > -p 5432 -U postgres -d $DBLIST -c "GRANT CONNECT ON DATABASE "$DBLIST" TO > cpupdate" > > ERROR: database "cdf_100_1313" does not exist Likely a quoting issue. Karsten Hilbert -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B

database "cdf_100_1313" does not exist

2019-09-09 Thread nikhil raj
/11/bin/psql -p 5432 -U postgres -d $DBLIST -c "GRANT CONNECT ON DATABASE "$DBLIST" TO cpupdate" ERROR: database "cdf_100_1313" does not exist