Re: [GENERAL] Where to start, graphs and routing.

2011-08-15 Thread fork
Ondrej Ivanič gmail.com> writes: > On 14 August 2011 20:25, k_b yahoo.se> wrote: > > Hi. > > For learning purpose i would like to make a small database with a small > > graph of locations, roads and public transport information. > > Then calculate the fastest or cheapest way between two points.

Re: [GENERAL] Inspecting a DB - psql or system tables ?

2011-05-27 Thread fork
Andre Majorel teaser.fr> writes: > > Suppose you want to write a program that connects to a > PostgreSQL database and lists its tables and views, the type of > their columns and their relationships (REFERENCES) for automatic > joins. I personally would try to hit the "informat_schema", which is

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread fork
yahoo.com> writes: > > Hi, > > Yes. Computer based training. A psql prompt and the excellent postgresql documentation? (Sorry to be flip, but typing in examples and fixing mistakes and tweaking input was how I learned... Hopefully one of the consulting guys on the list will come back with

Re: [GENERAL] Connecting matlab with postgresql

2011-04-29 Thread fork
Sukuchha Shrestha yahoo.de> writes: > Could anybody explain here how to connect in a detailed step ! Consider me studying in class 1 of postgresql when explaining :) It may not be much help to you, but on a Unix shell I tend to run psql through some text manipulation pipes and then into a csv wh

Re: [GENERAL] schemas for organizing tables

2011-04-29 Thread fork
Seb gmail.com> writes: > The database stores information related to biological research. The > bulk of the tables describe things like individual ID, morphometrics, > and behavioural data on all the individuals in several studies. > However, there are a few tables that do not relate to the resea

Re: [GENERAL] Planner Row Estimate with Function

2009-12-29 Thread Michael Fork
That solved it. Thanks! Michael - Original Message From: Tom Lane To: Michael Fork Cc: pgsql-general@postgresql.org Sent: Tue, December 29, 2009 11:19:42 PM Subject: Re: [GENERAL] Planner Row Estimate with Function Michael Fork writes: >> Also, what happened to the type=&

Re: [GENERAL] Planner Row Estimate with Function

2009-12-29 Thread Michael Fork
0'::text = ANY (parsecardidfromreferencecode(reference_code))) -> Bitmap Index Scan on idx_event_card_id (cost=0.00..1668821.37 rows=44565021 width=0) Thanks. Michael - Original Message From: Pavel Stehule To: Michael Fork Cc: pgsql-general@postgresql.org Sent: Tue, December 2

Re: [GENERAL] Planner Row Estimate with Function

2009-12-29 Thread Michael Fork
, this is partial index. I should have included the index definition earlier: # CREATE INDEX CONCURRENTLY idx_event_card_id ON trail.event(parsecardidfromreferencecode(reference_code)) WHERE type = 'CREDIT'; Thanks. Michael - Original Message From: Tom Lane To: Michae

Re: [GENERAL] Planner Row Estimate with Function

2009-12-29 Thread Michael Fork
=0.00..401311.59 rows=223890 width=103) Index Cond: ("substring"(reference_code, 3, 13) = '057729970'::text) (2 rows) Thanks. Michael - Original Message From: Pavel Stehule To: Michael Fork Cc: pgsql-general@postgresql.org Sent: Tue, December 29, 2009 12:

[GENERAL] Planner Row Estimate with Function

2009-12-29 Thread Michael Fork
I have an index scan on a custom function that is returning a wildly incorrect row estimate that is throwing off the rest of the query planning. The result of the function is roughly unique - there are a handful with multiple entries - but the planner is estimating 227,745 rows. I re-ran ANALY

Re: [GENERAL] Select/Group by/Order by question

2004-04-09 Thread Michael Fork
How about: select to_char(mtrantime,'mm-dd hh AM') as datetime, to_char(mtrantime,'AM') as sort_field, count(*) as tot from memtran group by sort_field, datetime order by sort_field, datetime; Then ignore the sort_field column? Michael "Mike Nolan" <[EMAIL PROTECTED]> wrote

Re: [GENERAL] internationalizing text

2001-03-23 Thread Michael Fork
You can use a where clause when selecting from a veiew, so the following should work for you: CREATE VIEW my_view AS SELECT o.*, n.descr, n.lang FROM nation n, org o WHERE o.nation = n.code SELECT * FROM my_view WHERE n.lang = someKnownQuantity Michael Fork - CCNA - MCP

[GENERAL] AGE() function

2001-03-14 Thread Michael Fork
Can someone tell me what I am missing here... Thanks Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio radius=# BEGIN; BEGIN radius=# select age(tstamp, now()) from radacct limit 1; age -- 03:37:08 ago (1 row) radius=# select age(now

Re: [GENERAL] Re: SERIAL values

2001-03-02 Thread Michael Fork
, you recieve the last value used by *your backend* (regardless of what others have done). Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Fri, 2 Mar 2001, Gregory Wood wrote: > SELECT currval('Table_SerialField_SEQ'); > > Note: This selec

Re: [GENERAL] order of clauses

2001-02-16 Thread Michael Fork
vals WHERE y > 0; SELECT a.x/b.y FROM vals a, valid_vals b WHERE (a.x / b.y) > 1 Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Wed, 14 Feb 2001, Patrick Welche wrote: > create table vals ( > x float, > y float > ); > insert

Re: [GENERAL] Case insensitive selects?

2001-02-14 Thread Michael Fork
Indexes *can* and *will* be used if you create the appropiate functional indexes, i.e: CREATE INDEX idx_table_field_upper ON table(upper(field)); SELECT field FROM table WHERE upper(field) LIKE upper('some string'); Michael Fork - CCNA - MCP - A+ Network Support - Toledo Inter

Re: [GENERAL] case insensitive unique index

2001-01-30 Thread Michael Fork
You can create a case insensitive, unique index like this: CREATE UNIQUE INDEX indexname ON tablename (lower(fieldname)) Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 30 Jan 2001, Culley Harrelson wrote: > is there a way to make a unique in

Re: [GENERAL] Order of Rules

2001-01-30 Thread Michael Fork
Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 30 Jan 2001, Nelio Alves Pereira Filho wrote: > Yes, but how can I pass a reference of the row just inserted to the > trigger?? > > adb wrote: > > > > Sounds like you need to use a

Re: [GENERAL] Stupid SQL Question:

2000-11-14 Thread Michael Fork
Try these queries... SELECT injdate, outcome, count(outcome) FROM safety GROUP BY injdate,outcome; or SELECT outcome, count(outcome) FROM safety WHERE injdate='2000-11-14' GROUP BY outcome; Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On T

Re: [GENERAL] Sequencial scan over primary keys

2000-11-10 Thread Michael Fork
acct on tiacct (cost=0.00..253.88 rows=96 width=44 ^^ In this situation Postgres will use the seq scan, rather than the index scan, due to its cheaper cost. Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio