pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Basic question.
3+ messages / 2 participants
[nested] [flat]

* Basic question.
@ 2002-10-24 08:15  andres javier garcia garcia <andresjavier.garcia@wanadoo.es>
  0 siblings, 2 replies; 3+ messages in thread

From: andres javier garcia garcia @ 2002-10-24 08:15 UTC (permalink / raw)
  To: pgsql-sql

Hi;
I'm sorry for ask this basic question. But I can't find in the documentation.

I'm connected to a database; and how can I execute a query that I've got in a 
file?

And. If I'm not connected to any database. Can I execute a file that makes a 
query on a database?


Thanks
-----------------
Javier



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Basic question.
@ 2002-10-24 08:59  Tomasz Myrta <jasiek@klaster.net>
  parent: andres javier garcia garcia <andresjavier.garcia@wanadoo.es>
  1 sibling, 0 replies; 3+ messages in thread

From: Tomasz Myrta @ 2002-10-24 08:59 UTC (permalink / raw)
  To: andres javier garcia garcia <andresjavier.garcia@wanadoo.es>; +Cc: pgsql-sql

Uz.ytkownik andres javier garcia garcia napisa?:
> Hi;
> I'm sorry for ask this basic question. But I can't find in the documentation.
> 
> I'm connected to a database; and how can I execute a query that I've got in a 
> file?
> 
> And. If I'm not connected to any database. Can I execute a file that makes a 
> query on a database?
But how are you connected to database?
If you are using tool named "psql" you can use "\i filename"
or you can do from command line psql <database> -U <user> <filename>

Tomasz Myrta




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Basic question.
@ 2002-10-24 09:14  Tomasz Myrta <jasiek@klaster.net>
  parent: andres javier garcia garcia <andresjavier.garcia@wanadoo.es>
  1 sibling, 0 replies; 3+ messages in thread

From: Tomasz Myrta @ 2002-10-24 09:14 UTC (permalink / raw)
  To: andres javier garcia garcia <andresjavier.garcia@wanadoo.es>; +Cc: pgsql-sql

> And. If I'm not connected to any database. Can I execute a file that makes a 
> query on a database?
Sorry, I made a mistake
psql -f <filename> -U <user> <database>
I'm not sure, but you can add export PGPASSWORD=<password> before this 
command if you need a password.
Tomasz Myrta




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-10-24 09:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-10-24 08:15 Basic question. andres javier garcia garcia <andresjavier.garcia@wanadoo.es>
2002-10-24 08:59 ` Tomasz Myrta <jasiek@klaster.net>
2002-10-24 09:14 ` Tomasz Myrta <jasiek@klaster.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox