Re: [SQL] Need magical advice for counting NOTHING

2009-07-22 Thread Shane Ambler
user_name, log_type_fk ORDER BY user_name, log_type_fk -- Shane Ambler pgSQL (at) Sheeky (dot) Biz -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] .psql_history": No such file

2009-06-27 Thread Shane Ambler
unt the history file will be saved into your home folder not the postgresql install/data file dir. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] how to update 400 000 register not at the same time?

2008-12-02 Thread Shane Ambler
users looking at some old rows at the same time as some updated rows. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] wired behaviour

2008-11-28 Thread Shane Ambler
l anything other than NULL It is a concept that catches those new to databases (and sometimes not so new). -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscrip

Re: [SQL] truncate vs. delete

2008-07-24 Thread Shane Ambler
st; DROP TABLE Time: 45.261 ms postgres=# shows a 10ms difference between truncate and drop. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Parallel updates on multiple cores

2008-06-09 Thread Shane Ambler
e. Without an order by in the select the rows can be returned and updated in any order. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Curious about wide tables.

2008-04-27 Thread Shane Ambler
, invoice sent, who entered it and when.. Sometimes you can have a lot of data that makes up one instance. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] connections between servers

2008-04-03 Thread Shane Ambler
pending on your needs. There was a recent discussion in the general mailing list about this. http://archives.postgresql.org/pgsql-general/2008-03/msg01343.php -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-sql mailing list (pgsql-sql@postgres

Re: [SQL] Export Access 97 to PostgreSQL

2008-03-26 Thread Shane Ambler
. Basically any structured text file can be used as you have the option of specifying what characters are used to separate fields etc when you import to postgresql. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Postgres roles

2008-02-09 Thread Shane Ambler
em to psql. "REVOKE sti FROM "+username+";" "GRANT sti_group TO "+username+";" "GRANT SELECT ON "+tablename+" TO sti_group;" ... ... The second may be the way to go at least for the removing and adding group memberships from sti to sti_gro

Re: [SQL] Postgres roles

2008-02-08 Thread Shane Ambler
the group or simply sti_group. I am guessing that you have an issue because you now have one role called sti - that has carried the group members from the old version - this is the admin userid used to login but because it is used as a group it passes it's privileges to all members of st

Re: [SQL] Serial not nulla

2008-02-08 Thread Shane Ambler
just add a user_id column and leave the INDEX1 as it is) It's not recommended but you could also have the table without a primary key allowing duplicate value combinations. This would prevent you updating a single row though. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky

Re: [SQL] SQL question: Highest column value of unique column pairs

2008-01-12 Thread Shane Ambler
corestable union select fnam2 as fname,lname2 as lname, score2 as score from myscorestable) as unionTable order by score desc limit 1 Shane Ambler wrote: Kevin Jenkins wrote: Hi, I have the following table which holds the result of 1 on 1 matches: FName1, LName1, Score1, FName2, LName2, Sc

Re: [SQL] SQL question: Highest column value of unique column pairs

2008-01-11 Thread Shane Ambler
order by 3 -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that

Re: [SQL] sql query question ?

2007-12-29 Thread Shane Ambler
as unmetered_travel from vehicle_duty_cycle_summary v1 where v1.vehicle_master_id = 4; If this isn't the way it should work you should be able to adapt the query to match your definition of idle time. -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http:/

Re: [SQL] join on three tables is slow

2007-12-09 Thread Shane Ambler
s listed with every myfile row - that means you will get 313,800 rows from this join with your other joins and where clause then trim that down to the final result. I would also say that the rest of your joins don't appear to be what you really want. (but part of them may belong in the whe

Re: [SQL] Is there anything special about pg_dump's compression?

2007-11-16 Thread Shane Ambler
tents as one file - allowing duplicates in different files to be compressed the way the above example does. -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, ple

Re: [SQL] Why does the sequence skip a number with generate_series?

2007-10-04 Thread Shane Ambler
be the planner or the generate series function could use a temporary table to give the same results as select from generate_series() -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 1: if posting/read

Re: [SQL] Format intervall as hours/minutes etc

2007-09-16 Thread Shane Ambler
is the easiest point to start your calcs. Maybe this can be a feature request - functions to give an interval in total number of days/hours/minutes instead of years months days -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)

Re: [SQL] inheritance

2007-03-08 Thread Shane Ambler
e for each month's worth of data. -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column

Re: [SQL] inheritance

2007-03-08 Thread Shane Ambler
to the apples or oranges tables. Maybe then you'll add a table basket that has a foreign key to the fruit table... ;-) -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] How to store a password encripted in a userdefinedtable

2007-03-01 Thread Shane Ambler
gt; > > John DeSoi, Ph.D. > > > http://pgedit.com/ > > > Power Tools for PostgreSQL > > > > > > > > > ---(end of > > broadcast)--- > > > TIP 9: In versions below 8.0, the planner will ignore your desire to >

Re: [SQL] How to store a password encripted in a user defined table

2007-03-01 Thread Shane Ambler
This doesn't give you an encrypted data type (but you could set that up if you wish) it will give you functions that you can use. Of course that would mean they get sent through the client connection as clear text unless you are using an SSL client connection. -- Shane Ambler [EMAIL PROT

Re: [SQL] How to union table without union statement?

2007-03-01 Thread Shane Ambler
MAIL PROTECTED] Thank you. -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Conditional SQL Query

2007-01-11 Thread Shane Ambler
.product_code='two' you will get - two test twotemplate parts 2.2 then change both WHERE clauses to PRD.product_code='one' you will get - one test one1 special list1.1 -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Autovaccum

2006-12-01 Thread Shane Ambler
or 2 times a day using smaller thresholds. If you are adding 10,000 records an hour then you will want it to run more often. 2006/11/30, Shane Ambler <[EMAIL PROTECTED]>: Alvaro Herrera wrote: > Ezequias Rodrigues da Rocha wrote: >> Hi list, >> >> I would like to k

Re: [SQL] Autovaccum

2006-11-30 Thread Shane Ambler
thout deletes a plain vacuum won't achieve a great deal, but a regular VACUUM ANALYZE (as done by autovacuum) will make a difference to the performance of your database. If no data in your db changes then you won't have to bother vacuuming. -- Shane Ambler [EMAIL PROTECTED] Get She

Re: [SQL] consistent random order

2006-11-30 Thread Shane Ambler
nformation about cursor 18:25 < rtfm_please> see http://www.postgresql.org/docs/current/static/plpgsql-cursors.html 18:25 < rtfm_please> or http://www.postgresql.org/docs/current/static/sql-declare.html With a CURSOR, you get one result-set and can walk through this result.

Re: [SQL] Inserting data in composite types!

2006-11-13 Thread Shane Ambler
bably as CREATE TYPE salary AS( salary numeric(10,2), a date, b date ); You can then INSERT INTO employee VALUES (1,'Hard Worker','(1000.00, 2006/10/10, 2006/12/10)'); -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz