473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

pqAdmin3

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 ma*******@postgresql.org

Nov 23 '05 #1
9 2277
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

Nov 23 '05 #2
On Sun, 2004-10-24 at 19:25 -0400, Ken Tozier wrote:
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 | ro***@planetargon.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-----

Nov 23 '05 #3
Ken Tozier <ke*******@comcast.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

Nov 23 '05 #4
Doug, Robby,

Thanks. That did the trick.

Ken
On Oct 24, 2004, at 8:02 PM, Doug McNaught wrote:
Ken Tozier <ke*******@comcast.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

Nov 23 '05 #5
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 ma*******@postgresql.org)

Nov 23 '05 #6
Ken Tozier <ke*******@comcast.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.

regards, tom lane

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

Nov 23 '05 #7

On Oct 25, 2004, at 12:35 AM, Tom Lane wrote:
Ken Tozier <ke*******@comcast.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

Nov 23 '05 #8
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:
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 ma*******@postgresql.org

--
Jeff Davis <jd**********@empires.org>
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #9
--- Ken Tozier <ke*******@comcast.net> escribió:
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

Nov 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.