![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
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, |
#4
| |||
| |||
|
|
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? |
#5
| |||
| |||
|
|
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 |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
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. |
#9
| |||
| |||
|
|
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 -- |
#10
| |||
| |||
|
|
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') |
![]() |
| Thread Tools | |
| Display Modes | |
| |