Re: [GENERAL] How to make a non-removable row in a table?

2012-01-29 Thread Jasen Betts
On 2011-12-19, Капралов Александр wrote: > Hi all. > > How to make a non-removable row in a table? reference it from another table. -- ⚂⚃ 100% natural -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpre

Re: [GENERAL] Best way to create unique primary keys across schemas?

2012-01-29 Thread Jasen Betts
On 2012-01-23, panam wrote: > Hi, > > If I'd like to have primary keys generated ("numeric" style, no UUIDs) that > are unique across schemas is the best option to allocate a fixed sequence > range (min,max) to the sequences of all schemas? given that challenge the easiest solution is to just cre

Re: [GENERAL] PG migration policy

2012-01-29 Thread Allan Kamau
Thank you Sim, Bill, Andy, Scott and Tomas for all your suggestions. Indeed I have now learnt formulate such a document. The database we plan to move is used for research and it resides along side several other applications on the same hardware. The idea is to move the entire database cluster to a

Re: [GENERAL] Question about (probably wrong) index scan cost for conditional indexes

2012-01-29 Thread Tom Lane
Maxim Boguk writes: > I know there is issue with statistics over intarrays (it was there > very long time and sometime it's complicating things a lot). > However, the 100x cost difference between: > SELECT * from test order by id limit 100; (over "primary key (id)" btree > index) > Limit (cos

Re: [GENERAL] Question about (probably wrong) index scan cost for conditional indexes

2012-01-29 Thread Maxim Boguk
On Mon, Jan 30, 2012 at 12:02 PM, Tom Lane wrote: > Maxim Boguk writes: >> Seems previous test case not clear demonstrate the problem which i have >> stuck with. >> Now much better and close to reality test case: > > AFAICT, these behaviors all boil down to the fact that contrib/intarray > doesn'

Re: [GENERAL] MS Access easier with PostgreSQL or MySQL?

2012-01-29 Thread Adrian Klaver
On Sunday, January 29, 2012 2:27:07 pm gvim wrote: > I want to use MS Access 2007 as a front end to a more robust/FOSS database. > Which is more compatible - MySQL or PostgreSQL? Unbiased answers please > :-). Honestly the compatibility probably has more to do with the Access/ODBC end of things t

Re: [GENERAL] Question about (probably wrong) index scan cost for conditional indexes

2012-01-29 Thread Tom Lane
Maxim Boguk writes: > Seems previous test case not clear demonstrate the problem which i have > stuck with. > Now much better and close to reality test case: AFAICT, these behaviors all boil down to the fact that contrib/intarray doesn't provide a real cost estimator for its && operator. It's us

Re: [GENERAL] Interval ordering

2012-01-29 Thread Adam Rich
>> try this: >> select mytime from mytable order by abs(extract(epoch from >> (usertime-mytime))) asc limit 5; >> SELECT ts_fld2,abs(extract(epoch from '2011-03-25 >> 14:15:25-07'::timestamptz)-extract(epoch from ts_fld2)) from timestamp_test >> order >> by abs(extract(epoch from '2011-03-25 >

Re: [GENERAL] Interval ordering

2012-01-29 Thread Ondrej Ivanič
Hi, On 30 January 2012 09:19, Adam Rich wrote: > desired time, I want to show them the 5 times from the table that are > closest to their > > input.  I expected to do this using abs() like such: > > select mytime from mytable order by abs(usertime-mytime) asc limit 5; > > However, the difference

Re: [GENERAL] Interval ordering

2012-01-29 Thread Adrian Klaver
On Sunday, January 29, 2012 2:39:12 pm Adam Rich wrote: > > How about something like: > > test(5432)aklaver=>SELECT ts_fld2,now()-ts_fld2 from timestamp_test order > > by > > > now()-ts_fld2 limit 5; > > Thanks Adrian, > Let me explain the problem better. Say my table has 24 entries, one for >

Re: [GENERAL] Interval ordering

2012-01-29 Thread Adam Rich
> How about something like: > test(5432)aklaver=>SELECT ts_fld2,now()-ts_fld2 from timestamp_test order by > now()-ts_fld2 limit 5; Thanks Adrian, Let me explain the problem better. Say my table has 24 entries, one for each hour, midnight through 11 pm. If the user enters "6:30 PM", I want to

Re: [GENERAL] Interval ordering

2012-01-29 Thread Adrian Klaver
On Sunday, January 29, 2012 2:19:38 pm Adam Rich wrote: > Hello, > > I have a table with a list of times. When the user provides my application > with a > > desired time, I want to show them the 5 times from the table that are > closest to their > > > > Is this ugly query really necessary fo

[GENERAL] MS Access easier with PostgreSQL or MySQL?

2012-01-29 Thread gvim
I want to use MS Access 2007 as a front end to a more robust/FOSS database. Which is more compatible - MySQL or PostgreSQL? Unbiased answers please :-). gvim -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/

[GENERAL] Interval ordering

2012-01-29 Thread Adam Rich
Hello, I have a table with a list of times. When the user provides my application with a desired time, I want to show them the 5 times from the table that are closest to their input. I expected to do this using abs() like such: select mytime from mytable order by abs(usertime-mytime) asc l

Re: [GENERAL] Simplifying the tsvector format for simple glossaries

2012-01-29 Thread Oleg Bartunov
Always use strip(to_tsvector()) and you'll be happy. Stop words affect tsvector size, so if you don't search them, don't store. strip() function described in docs. Oleg On Sun, 29 Jan 2012, Marc Mamin wrote: Hello, We have a text search on data from error logs, and our application offer a

[GENERAL] Simplifying the tsvector format for simple glossaries

2012-01-29 Thread Marc Mamin
Hello, We have a text search on data from error logs, and our application offer a rather simple search on lexemes only (no weighting, no neighbouring ...). This works quite well, except when the applications generating the logs get mad and we have to handle millions of messages per day :-) We al

Re: [GENERAL] [pgeu-general] FOSDEM booth volunteer

2012-01-29 Thread Dave Page
On Sun, Jan 29, 2012 at 7:33 PM, Andreas 'ads' Scherbaum wrote: > > Hi all, > > if you are attending FOSDEM next week in Brussels and are willing to help on > the PostgreSQL booth, please respond to me directly. > > We are planning to print badges for everyone. In your reply, please include > any

Re: [GENERAL] [pgeu-general] FOSDEM booth volunteer

2012-01-29 Thread Peter Geoghegan
Hi Ads, On 29 January 2012 19:33, Andreas 'ads' Scherbaum wrote: > if you are attending FOSDEM next week in Brussels and are willing to help on > the PostgreSQL booth, please respond to me directly. > > We are planning to print badges for everyone. In your reply, please include > any (human) lang

[GENERAL] FOSDEM booth volunteer

2012-01-29 Thread Andreas 'ads' Scherbaum
Hi all, if you are attending FOSDEM next week in Brussels and are willing to help on the PostgreSQL booth, please respond to me directly. We are planning to print badges for everyone. In your reply, please include any (human) language which you are familiar with. There will be a small icon

Re: [GENERAL] PG migration policy

2012-01-29 Thread Tomas Vondra
On 29.1.2012 07:30, Allan Kamau wrote: > Hi, > This is definitely off topic, I apologize. > We are planning to move our PostgreSQL installation from a shared > server to a dedicated server. I have been given the responsibility of > writing a migration policy document for this operation. This would

Re: [GENERAL] PG migration policy

2012-01-29 Thread Scott Marlowe
On Sat, Jan 28, 2012 at 11:30 PM, Allan Kamau wrote: > Hi, > This is definitely off topic, I apologize. > We are planning to move our PostgreSQL installation from a shared > server to a dedicated server. I have been given the responsibility of > writing a migration policy document for this operati

Re: [GENERAL] PG migration policy

2012-01-29 Thread Andy Colson
On 01/29/2012 12:30 AM, Allan Kamau wrote: Hi, This is definitely off topic, I apologize. We are planning to move our PostgreSQL installation from a shared server to a dedicated server. I have been given the responsibility of writing a migration policy document for this operation. This would be m

Re: [GENERAL] PG migration policy

2012-01-29 Thread Bill Moran
In addition to all this, you will need to outline an actual plan for the migration itself: 1) Steps to migrate 2) Testing strategy to ensure the migration actually worked 3) Estimated time 3a) How much of that time is actual downtime 4) Fallback plan in case the migration fails For such document

Re: [GENERAL] Index on parent/child hierarchy

2012-01-29 Thread Dmitriy Igrishin
Hey, 2012/1/25 Merlin Moncure > On Wed, Jan 25, 2012 at 5:54 AM, Jason Armstrong > wrote: > > Hi > > > > I'm looking for advice on the best way to index a table that is defined > as: > > > > create table uuid.master(id uuid, parent uuid references > > uuid.master(id), type_id smallint, primary

Re: [GENERAL] PG migration policy

2012-01-29 Thread Sim Zacks
You are moving to a dedicated server for a reason, most probably performance. The intro section of the document should discuss the reasons you are moving and what you hope to accomplish. Hardware - The discuss the new platform that you are moving to, in terms of how it will perform better. Importa