Thread: Backup DB not getting connected

Backup DB not getting connected

From
"J S B"
Date:
Hi,
I took a back up of my database and restored it in a new DB..When I'm trying to connect to the new DB from a client machine using ECPG connection techniques, it says newDB doesn't exist.
There's another DB in the same DB server and if I try and connect to that DB then it doesn't cry over anything.

Thanks
Jas

Re: Backup DB not getting connected

From
Shane Ambler
Date:
J S B wrote:
> Hi,
> I took a back up of my database and restored it in a new DB..When I'm
> trying
> to connect to the new DB from a client machine using ECPG connection
> techniques, it says newDB doesn't exist.
> There's another DB in the same DB server and if I try and connect to
> that DB
> then it doesn't cry over anything.
>
> Thanks
> Jas
>
I am guessing that you can verify that the newDB exists and has the data
you just have trouble from the ECPG client from any machine.

I would check access privileges - does the user you log in as using ECPG
have access to newDB? - the 'DB doesn't exist' may be a wrong error
which should say access denied.

Re: Backup DB not getting connected

From
"J S B"
Date:
The user in the client machine is usrxyz (a unix user role) and user role that owns newDB is userxyz (a db user role)....
works fine with another database in the same database server with same user role combination.
Don't know whats going wrong..

On 10/13/06, Shane Ambler <pgsql@007marketing.com> wrote:
J S B wrote:
> Hi,
> I took a back up of my database and restored it in a new DB..When I'm
> trying
> to connect to the new DB from a client machine using ECPG connection
> techniques, it says newDB doesn't exist.
> There's another DB in the same DB server and if I try and connect to
> that DB
> then it doesn't cry over anything.
>
> Thanks
> Jas
>
I am guessing that you can verify that the newDB exists and has the data
you just have trouble from the ECPG client from any machine.

I would check access privileges - does the user you log in as using ECPG
have access to newDB? - the 'DB doesn't exist' may be a wrong error
which should say access denied.

Re: Backup DB not getting connected

From
"J S B"
Date:
The only diff b/w the two DBs  is that the one getting connected has ACL value as blank and the one that doesn't get connected has the same ACL property values = {}

On 10/13/06, Shane Ambler <pgsql@007marketing.com> wrote:
J S B wrote:
> Hi,
> I took a back up of my database and restored it in a new DB..When I'm
> trying
> to connect to the new DB from a client machine using ECPG connection
> techniques, it says newDB doesn't exist.
> There's another DB in the same DB server and if I try and connect to
> that DB
> then it doesn't cry over anything.
>
> Thanks
> Jas
>
I am guessing that you can verify that the newDB exists and has the data
you just have trouble from the ECPG client from any machine.

I would check access privileges - does the user you log in as using ECPG
have access to newDB? - the 'DB doesn't exist' may be a wrong error
which should say access denied.

Re: Backup DB not getting connected

From
Tom Lane
Date:
"J S B" <jsbali@gmail.com> writes:
> The user in the client machine is usrxyz (a unix user role) and user role
> that owns newDB is userxyz (a db user role)....

I notice you keep spelling it as "newDB" ... is there a case-folding
issue here perhaps?

            regards, tom lane

Re: Backup DB not getting connected

From
"J S B"
Date:
well, newDB is the name of the database and that what I'm tryin to connect. I'm tryin to keep it the same case in ECPG code as it is in the Database.
Do u mean to say that combination of upper and lower case is not allowed?
in newDB , 'new' is all lower case and 'DB' is all upper.
 
Thanks,
Jas

 
On 10/13/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"J S B" <jsbali@gmail.com> writes:
> The user in the client machine is usrxyz (a unix user role) and user role
> that owns newDB is userxyz (a db user role)....

I notice you keep spelling it as "newDB" ... is there a case-folding
issue here perhaps?

                       regards, tom lane

Re: Backup DB not getting connected

From
Tom Lane
Date:
"J S B" <jsbali@gmail.com> writes:
> well, newDB is the name of the database and that what I'm tryin to connect.
> I'm tryin to keep it the same case in ECPG code as it is in the Database.
> Do u mean to say that combination of upper and lower case is not allowed?

No, I mean to say that names will get downcased in some situations if
not double-quoted.  I wonder whether your database is *really* named
"newDB" and not "newdb" ... if it is, you probably need double quotes in
your ECPG call, and if it isn't, you probably need to spell it as newdb
not newDB in ECPG.

            regards, tom lane

Re: Backup DB not getting connected

From
"J S B"
Date:
i changed my connection string as follows keeping newDB in double quotes

EXEC SQL CONNECT TO tcp:postgresql://192.168.1.1:5432/"newDB"

Unfortunately these doulbe quotes lead to syntax error.
Can you tell me what is the right syntax for the same.

Thanks

On 10/13/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"J S B" <jsbali@gmail.com> writes:
> well, newDB is the name of the database and that what I'm tryin to connect.
> I'm tryin to keep it the same case in ECPG code as it is in the Database.
> Do u mean to say that combination of upper and lower case is not allowed?

No, I mean to say that names will get downcased in some situations if
not double-quoted.  I wonder whether your database is *really* named
"newDB" and not "newdb" ... if it is, you probably need double quotes in
your ECPG call, and if it isn't, you probably need to spell it as newdb
not newDB in ECPG.

                        regards, tom lane