Backup DB not getting connected

Started by Jasbinder Baliover 19 years ago8 messagesgeneral
Jump to latest
#1Jasbinder Bali
jsbali@gmail.com

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

#2Shane Ambler
pgsql@007Marketing.com
In reply to: Jasbinder Bali (#1)
Re: Backup DB not getting connected

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.

#3Jasbinder Bali
jsbali@gmail.com
In reply to: Shane Ambler (#2)
Re: Backup DB not getting connected

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..

Show quoted text

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.

#4Jasbinder Bali
jsbali@gmail.com
In reply to: Shane Ambler (#2)
Re: Backup DB not getting connected

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 = {}

Show quoted text

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.

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jasbinder Bali (#3)
Re: Backup DB not getting connected

"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

#6Jasbinder Bali
jsbali@gmail.com
In reply to: Tom Lane (#5)
Re: Backup DB not getting connected

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

Show quoted text

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

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jasbinder Bali (#6)
Re: Backup DB not getting connected

"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

#8Jasbinder Bali
jsbali@gmail.com
In reply to: Tom Lane (#7)
Re: Backup DB not getting connected

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

Show quoted text

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