[GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Craig Ayliffe
Hi, I have several Postgres DB's not showing correct daylight savings time. From maillist etc I believe these are patched up to the right levels to have the correct time zones - but they don't seem to be working still. The unix date command show the correct dates. Server 1: postgresql-8.2.4

Re: [GENERAL] Numbering rows

2008-10-16 Thread David Rowley
Andreas Kretschmer wrote: Can you show an example for 8.4? It's not 100% certain that it will be possible for 8.4, probably though. select row_number() over (order by employeeid) as nrow,* from employee order by employeeid It's important to have both the order bys There is more information on

Re: [GENERAL] No select permission on a table but can query it

2008-10-16 Thread Michele Petrazzo - Unipex srl
Scott Marlowe wrote: I think that this is a strange question, but: I need to revoke the select permission on a table, but I also need to leave, with a function, a user do a query on column. A real case can be that a user test cannot have the permissions for do a select * from articles, but for

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Murray Fox
On 16/10/2008, at 7:23 PM, Craig Ayliffe wrote: Hi, I have several Postgres DB's not showing correct daylight savings time. From maillist etc I believe these are patched up to the right levels to have the correct time zones - but they don't seem to be working still. The unix date

Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Tomasz Ostrowski
On 2008-10-14 23:57, Mikkel Hogh wrote: one is the dreaded SELECT COUNT(pid) FROM url_alias which takes PostgreSQL a whopping 70.65ms out of the 115.74ms total for 87 queries. This is stupid. The Drupal code looks like this: // Use $count to avoid looking up paths in subsequent calls //

Re: [GENERAL] Opptimizing projections containing unused columns

2008-10-16 Thread 陈伟楠
Andrus,Hi! 1.From the query plan,it makes no difference. 2.PostgreSQL 8.0+ will not exclude columns c3..c20 while executing. 3.I just make a test,From query plan or executing time,it makes no difference. I'm from China.I hope you could see what I mean :)

Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Mikkel Høgh
It's not only to avoid one query, but to avoid one query every time drupal_lookup_path() is called (which is every time the system builds a link, which can be dozens of time on a page). So, I think it's probably a worthwhile tradeoff on MyISAM, because such queries are fast there, and you

Re: [GENERAL] Numbering rows

2008-10-16 Thread Mark Morgan Lloyd
David Rowley wrote: It's not 100% certain that it will be possible for 8.4, probably though. select row_number() over (order by employeeid) as nrow,* from employee order by employeeid That makes sense, thanks. So extracting rate-of-change etc. would be a join on two subselects followed by a

[GENERAL] Debian, backport and tsearch

2008-10-16 Thread Ivan Sergio Borgonovo
I'm using etch. I may upgrade to lenny in the not so far future if it becomes stable at least not earlier than 3-4 months. I'm in the need of tsearch but nothing has been written right now. The available options I see are: 1) use the contrib module on 8.1 2) backport 8.3 Considering I'll

[GENERAL] Are projected queries optimized like nonprojected ones

2008-10-16 Thread Andrus
I'm looking a hint for new application dynamic query builder creation for PostgreSQL 8.0+ Following two queries return same results: SELECT ... FROM t1 JOIN t2 USING (cx) LEFT JOIN t3 USING (cy) LEFT JOIN t4 USING (cz) WHERE ... and SELECT ... FROM (SELECT * FROM t1 JOIN t2 USING (cx) LEFT

Re: [GENERAL] Are projected queries optimized like nonprojected ones

2008-10-16 Thread A. Kretschmer
am Thu, dem 16.10.2008, um 14:43:42 +0300 mailte Andrus folgendes: I'm looking a hint for new application dynamic query builder creation for PostgreSQL 8.0+ Following two queries return same results: SELECT ... FROM t1 JOIN t2 USING (cx) LEFT JOIN t3 USING (cy) LEFT JOIN t4 USING (cz)

Re: [GENERAL] PQescapestringConn not found in libpq.dll

2008-10-16 Thread Tom Lane
=?ISO-8859-2?Q?Rafa=B3_Zi=F3=B3kowski?= [EMAIL PROTECTED] writes: I'm using postreSQL 8.2 on Windows Vista Small Business. I use the libpq C library to connect to database. Now I've needed a call to PQescapestringConn-function, but I get a message box with the information that the

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Roderick A. Anderson
Tom Lane wrote: Craig Ayliffe [EMAIL PROTECTED] writes: I have several Postgres DB's not showing correct daylight savings time. From maillist etc I believe these are patched up to the right levels to have the correct time zones - but they don't seem to be working still. No, you're behind

Re: [GENERAL] ADO TO ODBC

2008-10-16 Thread Sam Mason
On Thu, Oct 16, 2008 at 12:18:58AM +0200, salman Sheikh wrote: I have an application software which has connection with MS Access through DAO.I want to use same software without any changing with my new databank Postgresql through Odbc. I dont think so,that i can change it,I must develope

[GENERAL] server install recommendations?

2008-10-16 Thread Roberto Scattini
hi everybody: in a couple of days i will reinstall an offline database server. It's a old HP Proliant DL580 G3 with three disks (147 GB each). Currently it has a debian Sarge in a RAID5 hardware array ( with HP Smart Array 6i, [RAID bus controller: Compaq Computer Corporation Smart Array 64xx

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Alvaro Herrera
Roderick A. Anderson wrote: Doesn't Pg use tzdata (at least that's what it's called on for Redhat-ian distributions) for it's timezone information? Yes. It ships its own, unless told to use the system copy at build time. If it's not, then you must upgrade both copies (the system's and

Re: [GENERAL] server install recommendations?

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 7:22 AM, Roberto Scattini [EMAIL PROTECTED] wrote: hi everybody: in a couple of days i will reinstall an offline database server. It's a old HP Proliant DL580 G3 with three disks (147 GB each). Currently it has a debian Sarge in a RAID5 hardware array ( with HP Smart

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Tom Lane
Roderick A. Anderson [EMAIL PROTECTED] writes: Tom Lane wrote: No, you're behind the times: 8.2.4 and 8.1.9 are too old to know about this year's changes in southeast Australia DST laws. Which I imagine is what's biting you. Doesn't Pg use tzdata (at least that's what it's called on for

Re: [GENERAL] NATURAL JOINs

2008-10-16 Thread Marco Colombo
Scott Marlowe wrote: On Wed, Oct 15, 2008 at 10:17 AM, Richard Broersma [EMAIL PROTECTED] wrote: On Wed, Oct 15, 2008 at 9:03 AM, Reg Me Please [EMAIL PROTECTED] wrote: Both are perfectly right, indeed. Nonetheless, in my opinion a NATURAL JOIN exploiting the FKs instead of the column

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 12:23 AM, Craig Ayliffe [EMAIL PROTECTED] wrote: Hi, I have several Postgres DB's not showing correct daylight savings time. Server 1: postgresql-8.2.4 (Ubuntu 7.04) Server2: Postgresql-8.1.9 (on Ubuntu Dapper 6.06.1) Question: Why are you so far behind on pg

[GENERAL] PQescapestringConn not found in libpq.dll

2008-10-16 Thread Rafał Ziółkowski
Hallo, I'm using postreSQL 8.2 on Windows Vista Small Business. I use the libpq C library to connect to database. Now I've needed a call to PQescapestringConn-function, but I get a message box with the information that the ordinal 126 was not found in the dynamic library libpq.dll

further tests with 8.3 was: Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Ivan Sergio Borgonovo
On Tue, 14 Oct 2008 18:44:56 +0200 Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: BTW I hope someone may find good use of this: 2xXeon HT CPU 3.20GHz (not dual core), 4Gb RAM, RAID 5 SCSI * absolutely not tuned Apache * absolutely not tuned Drupal with little content, some blocks and some

Re: [GENERAL] Numbering rows

2008-10-16 Thread Richard Broersma
On Wed, Oct 15, 2008 at 10:21 PM, A. Kretschmer [EMAIL PROTECTED] wrote: Can you show an example for 8.4? I looked for ROW_NUMBER in the developer docs. I could only find it under the KEY WORDS list. I guess they haven't put in a good example yet. I saw this recently demonstrated at PgWest

Re: further tests with 8.3 was: Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Tom Lane
Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: I wonder if pg is using ssl even on sockets. No, it won't do that. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] ssl woes after 8.1 - 8.3 update

2008-10-16 Thread Ivan Sergio Borgonovo
Debian etch + backported postgresql I just copied pg_hba.conf from 8.1 to 8.3. on postgresql.conf ssl=true listen_addresses = '*' symlinked root.crt - /etc/ssl/certs/ssl-cert-snakeoil.pem Error connecting to the server: could not open certificate file /home/ivan/.postgresql/postgresql.crt: No

Re: [GENERAL] Numbering rows

2008-10-16 Thread Tom Lane
Richard Broersma [EMAIL PROTECTED] writes: I looked for ROW_NUMBER in the developer docs. I could only find it under the KEY WORDS list. I guess they haven't put in a good example yet. I saw this recently demonstrated at PgWest by Dave Fetter. He illustrated several example of how to use

Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Tomasz Ostrowski
On 2008-10-16 10:34, Mikkel Hogh wrote: It's not only to avoid one query, but to avoid one query every time drupal_lookup_path() is called (which is every time the system builds a link, which can be dozens of time on a page). Oh, $count is static. My bad. Using count for testing for empty

Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Stephen Frost
* Tomasz Ostrowski ([EMAIL PROTECTED]) wrote: There is an issue report with lengthy discussion on drupal.org: http://drupal.org/node/196862 And a proposed patch: http://drupal.org/files/issues/drupal_lookup_path-5.x.patch.txt which uses limit 1. This patch is not applied though. I don't know

Re: [GENERAL] PL/pgSQL stored procedure returning multiple result sets (SELECTs)?

2008-10-16 Thread Merlin Moncure
On Wed, Oct 15, 2008 at 5:48 PM, Bruce Momjian [EMAIL PROTECTED] wrote: Below is a very good summary of the limitations of our function capabilities compared to procedures, e.g.: o no transaction control in functions o no multi-query return values without using special syntax

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Roderick A. Anderson
Tom Lane wrote: Roderick A. Anderson [EMAIL PROTECTED] writes: Tom Lane wrote: No, you're behind the times: 8.2.4 and 8.1.9 are too old to know about this year's changes in southeast Australia DST laws. Which I imagine is what's biting you. Doesn't Pg use tzdata (at least that's what it's

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Tom Lane
Craig Ayliffe [EMAIL PROTECTED] writes: I have several Postgres DB's not showing correct daylight savings time. From maillist etc I believe these are patched up to the right levels to have the correct time zones - but they don't seem to be working still. No, you're behind the times: 8.2.4 and

Re: [GENERAL] PQescapestringConn not found in libpq.dll

2008-10-16 Thread Tomasz Myrta
Tom Lane napisal 16.10.2008 13:55: =?ISO-8859-2?Q?Rafa=B3_Zi=F3=B3kowski?= [EMAIL PROTECTED] writes: I'm using postreSQL 8.2 on Windows Vista Small Business. I use the libpq C library to connect to database. Now I've needed a call to PQescapestringConn-function, but I get a message box

Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread DelGurth
On Thu, Oct 16, 2008 at 4:40 PM, Stephen Frost [EMAIL PROTECTED] wrote: * Tomasz Ostrowski ([EMAIL PROTECTED]) wrote: I don't see 'limit 1' anywhere in that patch.. And you don't want to use 'limit 1' *and* count(*), that doesn't do what you're expecting (since count(*) is an aggregate and

Re: [GENERAL] PQescapestringConn not found in libpq.dll

2008-10-16 Thread Tomasz Myrta
Rafał Ziółkowski napisal 16.10.2008 13:16: Hallo, I'm using postreSQL 8.2 on Windows Vista Small Business. I use the libpq C library to connect to database. Now I've needed a call to PQescapestringConn-function, but I get a message box with the information that the ordinal 126 was

Re: [GENERAL] Chart of Accounts

2008-10-16 Thread James Hitz
As I said earlier, I am quite green with PGSQL, so please bear with me when I ask Stupid questions... --- On Mon, 13/10/08, justin [EMAIL PROTECTED] wrote: I just redid the accounting side of an application we have access to source code, so been here and done this. If i was not for the

Re: [GENERAL] server install recommendations?

2008-10-16 Thread Greg Smith
On Thu, 16 Oct 2008, Roberto Scattini wrote: It's a old HP Proliant DL580 G3 with three disks (147 GB each). Currently it has a debian Sarge in a RAID5 hardware array ( with HP Smart Array 6i, [RAID bus controller: Compaq Computer Corporation Smart Array 64xx (rev 01)] ). I think all of the

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 8:52 AM, Roderick A. Anderson [EMAIL PROTECTED] wrote: Tom Lane wrote: CentOS 5 -- three, four, or maybe more, updates this year so far. :-) Is there a way to determine from a binary install (Devrim GÜNDÜZ's rpms) if it uses the system timezone data or the build-in

Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Stephen Frost
* DelGurth ([EMAIL PROTECTED]) wrote: Seems Tomasz linked to the wrong patch. The patch he meant was: http://drupal.org/files/issues/drupal_lookup_path-6.x.patch.txt That's much better. Also nice to see people benchmark differences by just executing a query once[2][3] This thread is

Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Tomasz Ostrowski
On 2008-10-16 16:40, Stephen Frost wrote: There is an issue report with lengthy discussion on drupal.org: http://drupal.org/node/196862 And a proposed patch: I don't see 'limit 1' anywhere in that patch.. Sorry - haven't checked it - I have checked only a 6.x version

Re: [GENERAL] PQescapestringConn not found in libpq.dll

2008-10-16 Thread Tom Lane
Tomasz Myrta [EMAIL PROTECTED] writes: Rafa³ Zió³kowski napisal 16.10.2008 13:16: I'm using postreSQL 8.2 on Windows Vista Small Business. I use the libpq C library to connect to database. Now I've needed a call to PQescapestringConn-function, but I get a message box with the information

Re: [GENERAL] Chart of Accounts]

2008-10-16 Thread justin
James Hitz wrote: As I said earlier, I am quite green with PGSQL, so please bear with me when I ask Stupid questions... --- On Mon, 13/10/08, justin [EMAIL PROTECTED] wrote: I just redid the accounting side of an application we have access to source code, so been here and done this.

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Roderick A. Anderson
Scott Marlowe wrote: On Thu, Oct 16, 2008 at 8:52 AM, Roderick A. Anderson [EMAIL PROTECTED] wrote: Tom Lane wrote: CentOS 5 -- three, four, or maybe more, updates this year so far. :-) Is there a way to determine from a binary install (Devrim GÜNDÜZ's rpms) if it uses the system timezone

Re: [GENERAL] Drupal and PostgreSQL - performance issues?

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 9:26 AM, Stephen Frost [EMAIL PROTECTED] wrote: * DelGurth ([EMAIL PROTECTED]) wrote: Seems Tomasz linked to the wrong patch. The patch he meant was: http://drupal.org/files/issues/drupal_lookup_path-6.x.patch.txt That's much better. Also nice to see people benchmark

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 10:23 AM, Roderick A. Anderson [EMAIL PROTECTED] wrote: Scott Marlowe wrote: On Thu, Oct 16, 2008 at 8:52 AM, Roderick A. Anderson [EMAIL PROTECTED] wrote: Tom Lane wrote: CentOS 5 -- three, four, or maybe more, updates this year so far. :-) Is there a way to

Re: [GENERAL] Optimizing projections containing unused columns

2008-10-16 Thread Martijn van Oosterhout
On Wed, Oct 15, 2008 at 09:07:28PM +0300, Andrus wrote: Tom, This question is too vague to be answerable --- especially if you want an answer that applies across all 8.x releases. I'd suggest experimenting a bit using EXPLAIN ANALYZE to see what happens in your actual application. Thank

Re: [GENERAL] ssl woes after 8.1 - 8.3 update

2008-10-16 Thread Tomasz Myrta
Ivan Sergio Borgonovo napisal 16.10.2008 16:29: Debian etch + backported postgresql I just copied pg_hba.conf from 8.1 to 8.3. on postgresql.conf ssl=true listen_addresses = '*' symlinked root.crt - /etc/ssl/certs/ssl-cert-snakeoil.pem As described in documentation, giving root.crt to

Re: [GENERAL] ssl woes after 8.1 - 8.3 update

2008-10-16 Thread Ivan Sergio Borgonovo
On Thu, 16 Oct 2008 18:51:55 +0200 Tomasz Myrta [EMAIL PROTECTED] wrote: This one should be enough: http://www.postgresql.org/docs/current/interactive/ssl-tcp.html I've found this: http://quasiroot.wordpress.com/2007/07/22/postgresql-connectivity-with-jdbc-over-ssl/ and I got it working just a

Re: [GENERAL] Optimizing projections containing unused columns

2008-10-16 Thread Grzegorz Jaśkiewicz
not so smart yet ;) thickbook:~ gj$ psql gj Timing is on. psql (8.4devel) Type help for help. gj=# create table smartarse(id bigserial, v varchar not null , primary key (id, v)); NOTICE: CREATE TABLE will create implicit sequence smartarse_id_seq for serial column smartarse.id NOTICE: CREATE

Re: [GENERAL] Optimizing projections containing unused columns

2008-10-16 Thread Andrus
gj=# explain select count(*) from smartarse where v is null; Aggregate (cost=21.62..21.63 rows=1 width=0) - Seq Scan on smartarse (cost=0.00..21.60 rows=6 width=0) Thread question and sample was about using nested queries.

Re: [GENERAL] Optimizing projections containing unused columns

2008-10-16 Thread Andrus
So I do'nt understand how this applies to topic. I'm sorry, after re-reading yuor reply I understood this. You think thank PostgreSQL should use not null inforamtion from metadata. Maybe it is better to create separate static code analyzer like FxCop, Smokey or Gendarme for C# for PostgreSQL

Re: [GENERAL] PL/pgSQL stored procedure returning multiple result sets (SELECTs)?

2008-10-16 Thread Pavel Stehule
2008/10/16 Merlin Moncure [EMAIL PROTECTED]: On Wed, Oct 15, 2008 at 5:48 PM, Bruce Momjian [EMAIL PROTECTED] wrote: Below is a very good summary of the limitations of our function capabilities compared to procedures, e.g.: o no transaction control in functions o no

Re: [GENERAL] Optimizing projections containing unused columns

2008-10-16 Thread Grzegorz Jaśkiewicz
I just generally wanted to show, that even tho it is much smarter from version to version, it still has this little things. I generally don't put 'is null' or 'is not null' in queries on column that is 'not null' - but it is imo example of those little things, where postgres isn't so smart yet :)

[GENERAL] postgresql on 64-bit windows

2008-10-16 Thread Jeff Davis
It looks like there's no 64-bit version of postgresql for windows: http://swik.net/PostgreSQL/Planet+Postgresql/Magnus+Hagander:+PostgreSQL +vs+64-bit+windows but that the 32-bit version of postgresql works just fine on 32-bit or 64-bit windows, including Vista. Is this correct? There's a thread

[GENERAL] Drop database / database in use question

2008-10-16 Thread Dan Armbrust
I have some installation tools which in some cases need to replace a postgres database. For this example, assume my database name is 'fred'. Also, assume that no other processes are accessing this database. Any database access will come from my running installer. First, after validating some

Re: [GENERAL] Problems with Timezones in Australia

2008-10-16 Thread Craig Ayliffe
Hi All, I was in fact out-of-date with patches, and have fixed that - which has brought the zone files up to date. Will definitely be looking to upgrade all servers to 8.3 at some stage soon - all about scheduling outages and testing code before we do... Thanks for everyone's help appreciate

Re: [GENERAL] postgresql on 64-bit windows

2008-10-16 Thread Tom Lane
Jeff Davis [EMAIL PROTECTED] writes: There's a thread here about possibly supporting 64-bit postgresql on windows: http://archives.postgresql.org/pgsql-hackers/2008-07/msg00081.php Are there major issues holding that back or is it just a lack of demand? Both. It's a lot of work for

Re: [GENERAL] Drop database / database in use question

2008-10-16 Thread Tom Lane
Dan Armbrust [EMAIL PROTECTED] writes: First, after validating some passwords, my installer will run this command: psql -c select datname from pg_stat_activity where datname='fred' -U username -d template1 I then scan the output looking for 'fred'. My (perhaps incorrect) assumption is that

[GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Tim Uckun
Hey all. I am using postgres 8.3 with a rails application. I have a column defined like this. ALTER TABLE provisions ADD COLUMN provider_id integer; ALTER TABLE provisions ALTER COLUMN provider_id SET STORAGE PLAIN; ALTER TABLE provisions ALTER COLUMN provider_id SET NOT NULL; ALTER TABLE

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Chris
Tim Uckun wrote: Hey all. I am using postgres 8.3 with a rails application. I have a column defined like this. ALTER TABLE provisions ADD COLUMN provider_id integer; ALTER TABLE provisions ALTER COLUMN provider_id SET STORAGE PLAIN; ALTER TABLE provisions ALTER COLUMN provider_id SET NOT NULL;

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 9:09 PM, Tim Uckun [EMAIL PROTECTED] wrote: Hey all. I am using postgres 8.3 with a rails application. I have a column defined like this. ALTER TABLE provisions ADD COLUMN provider_id integer; ALTER TABLE provisions ALTER COLUMN provider_id SET STORAGE PLAIN; ALTER

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Tim Uckun
Not sure how you do this in rails but if you use DEFAULT in the query it works: create table a(a int default 5); CREATE TABLE insert into a(a) values (DEFAULT); INSERT 0 1 Unfortunately the SQL is being generated by the ORM. I really don't want to bypass the ORM that would be way too

[GENERAL] Question about fulltext search and to_tsvector function

2008-10-16 Thread Mike Christensen
Okay this one's driving me crazy. Should there be any difference between the following queries: SELECT R.Title FROM Recipes R WHERE (to_tsvector('english', title || description) @@ plainto_tsquery('Cake')); and SELECT R.Title FROM Recipes R WHERE (to_tsvector('english', description ||

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 9:26 PM, Tim Uckun [EMAIL PROTECTED] wrote: Not sure how you do this in rails but if you use DEFAULT in the query it works: create table a(a int default 5); CREATE TABLE insert into a(a) values (DEFAULT); INSERT 0 1 Unfortunately the SQL is being generated by the

Re: [GENERAL] Question about fulltext search and to_tsvector function

2008-10-16 Thread Tom Lane
Mike Christensen [EMAIL PROTECTED] writes: Okay this one's driving me crazy. Should there be any difference between the following queries: SELECT R.Title FROM Recipes R WHERE (to_tsvector('english', title || description) @@ plainto_tsquery('Cake')); and SELECT R.Title FROM Recipes R

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 9:09 PM, Tim Uckun [EMAIL PROTECTED] wrote: Hey all. I am using postgres 8.3 with a rails application. I have a column defined like this. ALTER TABLE provisions ADD COLUMN provider_id integer; ALTER TABLE provisions ALTER COLUMN provider_id SET STORAGE PLAIN; ALTER

Re: [GENERAL] Question about fulltext search and to_tsvector function

2008-10-16 Thread Mike Christensen
Hi guys - I half figured this out.. The problem is the vector is concatenating the fields together.. If I have a title of Iced Lemon Cake and the description is Tangy and sweet!, then the tsvector looks like this: 'ice':1 'lemon':2 'sweet':5 'caketangi':3 Cake and Tangy get parsed as

Re: [GENERAL] Question about fulltext search and to_tsvector function

2008-10-16 Thread Mike Christensen
That was it! So this is the standard way of doing this? It seems a bit messy to me, but I've gotten kinda used to Postgresql being almost annoyingly logical g So here's my new query: SELECT R.RecipeId, R.Title, R.Description FROM Recipes R WHERE (to_tsvector('english', title || ' ' ||

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Tim Uckun
Are you using the ruby-pg interface? I was under the impression it handled this properly. I am using postgres-pr -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Tim Uckun
On Fri, Oct 17, 2008 at 4:40 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Thu, Oct 16, 2008 at 9:09 PM, Tim Uckun [EMAIL PROTECTED] wrote: Hey all. I am using postgres 8.3 with a rails application. I have a column defined like this. ALTER TABLE provisions ADD COLUMN provider_id integer;

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Stephan Szabo
On Fri, 17 Oct 2008, Tim Uckun wrote: Is there a way to change this behavior so that an attempt to set the column to NULL will result in the default value being put in the field? I don't think so specifically with default, but you could use a before trigger instead that would put in a value

Re: [GENERAL] Question about fulltext search and to_tsvector function

2008-10-16 Thread Tom Lane
Mike Christensen [EMAIL PROTECTED] writes: This is exactly what you would do as well? I just want to make sure this isn't considered a hack.. It certainly works. What the docs seem to recommend though is concatenating the *output* of to_tsvector applied to each field, along the lines of

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 9:58 PM, Tim Uckun [EMAIL PROTECTED] wrote: On Fri, Oct 17, 2008 at 4:40 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Thu, Oct 16, 2008 at 9:09 PM, Tim Uckun [EMAIL PROTECTED] wrote: Hey all. I am using postgres 8.3 with a rails application. I have a column defined

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 10:01 PM, Stephan Szabo [EMAIL PROTECTED] wrote: On Fri, 17 Oct 2008, Tim Uckun wrote: Is there a way to change this behavior so that an attempt to set the column to NULL will result in the default value being put in the field? I don't think so specifically with

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Stephan Szabo
On Thu, 16 Oct 2008, Scott Marlowe wrote: On Thu, Oct 16, 2008 at 10:01 PM, Stephan Szabo [EMAIL PROTECTED] wrote: On Fri, 17 Oct 2008, Tim Uckun wrote: Is there a way to change this behavior so that an attempt to set the column to NULL will result in the default value being put in the

Re: [GENERAL] Question about NOT NULL and default values.

2008-10-16 Thread Scott Marlowe
On Thu, Oct 16, 2008 at 10:06 PM, Stephan Szabo [EMAIL PROTECTED] wrote: On Thu, 16 Oct 2008, Scott Marlowe wrote: On Thu, Oct 16, 2008 at 10:01 PM, Stephan Szabo [EMAIL PROTECTED] wrote: On Fri, 17 Oct 2008, Tim Uckun wrote: Is there a way to change this behavior so that an attempt to

Re: [GENERAL] postgresql on 64-bit windows

2008-10-16 Thread Magnus Hagander
Jeff Davis wrote: It looks like there's no 64-bit version of postgresql for windows: http://swik.net/PostgreSQL/Planet+Postgresql/Magnus+Hagander:+PostgreSQL +vs+64-bit+windows but that the 32-bit version of postgresql works just fine on 32-bit or 64-bit windows, including Vista. Is this