dbTalk Databases Forums  

pqAdmin3

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss pqAdmin3 in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Philip Pinkerton
 
Posts: n/a

Default pqAdmin3 - 10-24-2004 , 04:10 PM






When trying to connect to database via the pgAdmin3 GUI it asks for a
password. I use the same passworrd as I did when I connect to the DB via
command line but I get Ident error?

how do I set, re-set the password so I can use both the commandline and
pgAdmin to access edit by DB?

Thanks


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #2  
Old   
Ken Tozier
 
Posts: n/a

Default Importing a tab delimited text file - How? - 10-24-2004 , 06:25 PM






I've been looking though the PostgreSQL documentation but can't seem to
find a command for importing files. I read the documentation related to
large objects but this isn't what I'm looking for as I don't want to
import the entire file into a single field, I want to import it as a
table. I'm sure there's a way to do it but I can't seem to find the
magic command.

Could someone point me to (or provide) an example?

Thanks,

Ken


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #3  
Old   
Robby Russell
 
Posts: n/a

Default Re: Importing a tab delimited text file - How? - 10-24-2004 , 06:57 PM



On Sun, 2004-10-24 at 19:25 -0400, Ken Tozier wrote:
Quote:
I've been looking though the PostgreSQL documentation but can't seem to
find a command for importing files. I read the documentation related to
large objects but this isn't what I'm looking for as I don't want to
import the entire file into a single field, I want to import it as a
table. I'm sure there's a way to do it but I can't seem to find the
magic command.

Could someone point me to (or provide) an example?

Thanks,

\h COPY

The COPY command will help you with this.

-Robby


--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON | www.planetargon.com
* Portland, OR | robby (AT) planetargon (DOT) com
* 503.351.4730 | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBBfEFt0QaQZBaqXgwRAtwGAKDLFdagcePpU5vCgXNyqp K/ANpRcgCfbMwa
JrjABJax01ZKZkG6iio4nDk=
=hS7V
-----END PGP SIGNATURE-----



Reply With Quote
  #4  
Old   
Doug McNaught
 
Posts: n/a

Default Re: Importing a tab delimited text file - How? - 10-24-2004 , 07:02 PM



Ken Tozier <kentozier (AT) comcast (DOT) net> writes:

Quote:
I've been looking though the PostgreSQL documentation but can't seem
to find a command for importing files. I read the documentation
related to large objects but this isn't what I'm looking for as I
don't want to import the entire file into a single field, I want to
import it as a table. I'm sure there's a way to do it but I can't seem
to find the magic command.

Could someone point me to (or provide) an example?
You want the SQL COPY statement, or the \copy command in 'psql'.

-Doug

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #5  
Old   
Ken Tozier
 
Posts: n/a

Default Re: Importing a tab delimited text file - How? - 10-24-2004 , 08:09 PM



Doug, Robby,

Thanks. That did the trick.

Ken


On Oct 24, 2004, at 8:02 PM, Doug McNaught wrote:

Quote:
Ken Tozier <kentozier (AT) comcast (DOT) net> writes:

I've been looking though the PostgreSQL documentation but can't seem
to find a command for importing files. I read the documentation
related to large objects but this isn't what I'm looking for as I
don't want to import the entire file into a single field, I want to
import it as a table. I'm sure there's a way to do it but I can't seem
to find the magic command.

Could someone point me to (or provide) an example?

You want the SQL COPY statement, or the \copy command in 'psql'.

-Doug

---------------------------(end of
broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if
your
joining column's datatypes do not match


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
  #6  
Old   
Ken Tozier
 
Posts: n/a

Default Complex query need help with OR condition. - 10-24-2004 , 11:06 PM



I'm working on a query which works as expected when I leave out one of
the "OR" tests but when the "OR" is included, I get hundreds of
duplicate hits from a table that only contains 39 items. Is there a way
to write the following so that the "WHERE" clause tests for two
possible conditions?

Thanks for any help,

Ken


Here's the working query:

SELECT a.paginator, a.doc_name, (b.time - a.time) as elapsed_time FROM
pm_events as a, pm_events as b
WHERE a.event_code='pmcd'
AND b.event_code='pmcl'
AND a.doc_name=b.doc_name
AND a.paginator=b.paginator
AND a.time < b.time

When I add the OR clause things go haywire:

SELECT a.paginator, a.doc_name, (b.time - pm_events.time) as
elapsed_time FROM pm_events as a, pm_events as b
WHERE a.event_code='pmcd'
OR a.event_code='pmop'
AND b.event_code='pmcl'
AND a.doc_name=b.doc_name
AND a.paginator=b.paginator
AND a.time < b.time

Have also tried the following in the WHERE clause to no avail:

WHERE a.event_code IN {'pmcd', 'pmop'}
WHERE a.event_code=('pmcd' | 'pmop')


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #7  
Old   
Tom Lane
 
Posts: n/a

Default Re: Complex query need help with OR condition. - 10-24-2004 , 11:35 PM



Ken Tozier <kentozier (AT) comcast (DOT) net> writes:
Quote:
When I add the OR clause things go haywire:

SELECT a.paginator, a.doc_name, (b.time - pm_events.time) as
elapsed_time FROM pm_events as a, pm_events as b
WHERE a.event_code='pmcd'
OR a.event_code='pmop'
AND b.event_code='pmcl'
AND a.doc_name=b.doc_name
AND a.paginator=b.paginator
AND a.time < b.time
I think you need some parentheses, or at least a bit of thought about
what the OR is binding to.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
  #8  
Old   
Ken Tozier
 
Posts: n/a

Default Re: Complex query need help with OR condition. - 10-24-2004 , 11:45 PM




On Oct 25, 2004, at 12:35 AM, Tom Lane wrote:

Quote:
Ken Tozier <kentozier (AT) comcast (DOT) net> writes:
When I add the OR clause things go haywire:

SELECT a.paginator, a.doc_name, (b.time - pm_events.time) as
elapsed_time FROM pm_events as a, pm_events as b
WHERE a.event_code='pmcd'
OR a.event_code='pmop'
AND b.event_code='pmcl'
AND a.doc_name=b.doc_name
AND a.paginator=b.paginator
AND a.time < b.time

I think you need some parentheses, or at least a bit of thought about
what the OR is binding to.
The table stores "file open", "file create" and "file close" events
(pmop, pmcd, pmcl) What I'm trying to do is bind "open" and "create"
events to the next sequential close event for each document a
particular paginator works on. I also tried parentheses after the where
clause like so:

WHERE (a.event_code='pmcd' OR a.event_code='pmop')

But it only seems to recognize the first comparison ignoring whatever
comes after the OR


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



Reply With Quote
  #9  
Old   
Jeff Davis
 
Posts: n/a

Default Re: pqAdmin3 - 10-25-2004 , 12:01 AM



Perhaps the current authentication scheme you have set up is different
for local and remote host. It might be that pgAdmin is connecting from a
different machine? And if you're using ident authentication it might not
work from a remote machine the same as for local.

Please give more details, such as the contents of pg_hba.conf and the
way you're trying to connect from both psql and pgAdmin.

Regards,
Jeff Davis

On Sun, 2004-10-24 at 18:10 -0300, Philip Pinkerton wrote:
Quote:
When trying to connect to database via the pgAdmin3 GUI it asks for a
password. I use the same passworrd as I did when I connect to the DB via
command line but I get Ident error?

how do I set, re-set the password so I can use both the commandline and
pgAdmin to access edit by DB?

Thanks


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org
--
Jeff Davis <jdavis-pgsql (AT) empires (DOT) org>


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
  #10  
Old   
Jaime Casanova
 
Posts: n/a

Default Re: Complex query need help with OR condition. - 10-26-2004 , 02:54 PM



--- Ken Tozier <kentozier (AT) comcast (DOT) net> escribió:
Quote:
I'm working on a query which works as expected when
I leave out one of
the "OR" tests but when the "OR" is included, I get
hundreds of
duplicate hits from a table that only contains 39
items. Is there a way
to write the following so that the "WHERE" clause
tests for two
possible conditions?

Thanks for any help,

Ken


Here's the working query:

SELECT a.paginator, a.doc_name, (b.time - a.time) as
elapsed_time FROM
pm_events as a, pm_events as b
WHERE a.event_code='pmcd'
AND b.event_code='pmcl'
AND a.doc_name=b.doc_name
AND a.paginator=b.paginator
AND a.time < b.time

When I add the OR clause things go haywire:

SELECT a.paginator, a.doc_name, (b.time -
pm_events.time) as
elapsed_time FROM pm_events as a, pm_events as b
WHERE a.event_code='pmcd'
OR a.event_code='pmop'
AND b.event_code='pmcl'
AND a.doc_name=b.doc_name
AND a.paginator=b.paginator
AND a.time < b.time

Have also tried the following in the WHERE clause to
no avail:

WHERE a.event_code IN {'pmcd', 'pmop'}
WHERE a.event_code=('pmcd' | 'pmop')



the query with the OR clause says:

SELECT a.paginator, a.doc_name, (b.time -
pm_events.time)
+++++++++

meanwhile the other one says:
SELECT a.paginator, a.doc_name, (b.time - a.time)
+

Which pm_events table will the planner use a or b?? i
think in the second query you are confusing the
planner forcing a cartesian product.

regards,
Jaime Casanova

__________________________________________________ _______
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.