Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Alexander Farber
Hello, really good advices here! But - On Sun, Oct 17, 2010 at 2:37 AM, Rob Sargent wrote: > I just read the "anonymously" part, so I take it you have ruled out > recording the given coordinate components directly, in multiple columns > presumably?  Otherwise it seems you could then do a) a compo

Re: [GENERAL] installing from source in Windows

2010-10-16 Thread Craig Ringer
On 10/17/2010 12:25 AM, Rob Sargent wrote: No at all familiar with MinGW, but I've done some "./configure"s in my time. ./configure scripts 1) check to see what the local build environment contains and 2) which special feature you wish to toggle. But the pretty much assume a unix-like env. Coul

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Rob Sargent
I just read the "anonymously" part, so I take it you have ruled out recording the given coordinate components directly, in multiple columns presumably? Otherwise it seems you could then do a) a composite key and b) queries directly against coordinate values. Alexander Farber wrote: Thank y

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Darren Duncan
Alexander Farber wrote: I'm trying to create a table, where md5 strings will serve as primary keys. So I'd like to add a constraing that the key length should be 32 chars long (and contain [a-fA-F0-9] only): create table gps ( id varchar(32) primary key CONSTRAINT char_length(id)==32, stamp time

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Alexander Farber
Thank you for your advices. I actually would like to store GPS coordinates, but anonymously, so I was going to save md5(my_secret+IMEI) coming from a mobile... I have to lookup if uuid is supported there Regards Alex On Sat, Oct 16, 2010 at 11:08 PM, Rob Sargent wrote: > Merlin Moncure wrote:

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Rob Sargent
Merlin Moncure wrote: On Sat, Oct 16, 2010 at 12:15 PM, Alexander Farber wrote: Hello, I'm trying to create a table, where md5 strings will serve as primary keys. So I'd like to add a constraing that the key length should be 32 chars long (and contain [a-fA-F0-9] only): why don't y

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Merlin Moncure
On Sat, Oct 16, 2010 at 12:15 PM, Alexander Farber wrote: > Hello, > > I'm trying to create a table, where md5 strings will serve as primary keys. > So I'd like to add a constraing that the key length should be 32 chars long > (and contain [a-fA-F0-9] only): why don't you use the bytea type, and

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Guy Rouillier
On 10/16/2010 12:48 PM, Alexander Farber wrote: snake=> create table gps ( id varchar(32) primary key CONSTRAINT id_length char_length(id)=32, stamp timestamp DEFAULT current_timestamp, pos point); ERROR: syntax error at or near "char_length" LINE 2: id varchar(32) primary key CONSTRAINT id_len

Re: [GENERAL] Fastest way to check database's existence

2010-10-16 Thread Adrian Klaver
On Saturday 16 October 2010 8:13:12 am Kynn Jones wrote: > I want to code a Perl function (part of a Perl library) for determining the > existence of a particular database (in a given host/port). > > One way would be to just attempt making a connection to it, trapping any > errors upon failure (wit

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Raymond O'Donnell
On 16/10/2010 17:48, Alexander Farber wrote: snake=> create table gps ( id varchar(32) primary key CONSTRAINT id_length char_length(id)=32, stamp timestamp DEFAULT current_timestamp, pos point); ERROR: syntax error at or near "char_length" LINE 2: id varchar(32) primary key CONSTRAINT id_length

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Alexander Farber
snake=> create table gps ( id varchar(32) primary key CONSTRAINT id_length char_length(id)=32, stamp timestamp DEFAULT current_timestamp, pos point); ERROR: syntax error at or near "char_length" LINE 2: id varchar(32) primary key CONSTRAINT id_length char_length(...

Re: [GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Raymond O'Donnell
On 16/10/2010 17:15, Alexander Farber wrote: Hello, I'm trying to create a table, where md5 strings will serve as primary keys. So I'd like to add a constraing that the key length should be 32 chars long (and contain [a-fA-F0-9] only): create table gps ( id varchar(32) primary key CONSTRAINT ch

Re: [GENERAL] installing from source in Windows

2010-10-16 Thread Rob Sargent
No at all familiar with MinGW, but I've done some "./configure"s in my time. ./configure scripts 1) check to see what the local build environment contains and 2) which special feature you wish to toggle. But the pretty much assume a unix-like env. Could you put cygwin on rather than just ming

Re: [GENERAL] Automated Database Backups

2010-10-16 Thread Gary Chambers
John, > Does anyone have a way to run pg_dump from cron in a way that doesn't > require someone to enter the password on every run?  I get the following > error even when the backup user has read permissions on all application > databases. You can use the .pgpass file in the backup owner's home d

Re: [GENERAL] Automated Database Backups

2010-10-16 Thread Raymond O'Donnell
On 15/10/2010 22:12, John Iliffe wrote: Does anyone have a way to run pg_dump from cron in a way that doesn't require someone to enter the password on every run? I get the following error even when the backup user has read permissions on all application databases. You need to use a .pgpasss fi

[GENERAL] Constraint: string length must be 32 chars

2010-10-16 Thread Alexander Farber
Hello, I'm trying to create a table, where md5 strings will serve as primary keys. So I'd like to add a constraing that the key length should be 32 chars long (and contain [a-fA-F0-9] only): create table gps ( id varchar(32) primary key CONSTRAINT char_length(id)==32, stamp timestamp DEFAULT curr

Re: [GENERAL] Request for comment: pgjson project

2010-10-16 Thread Terry Laurenzo
Thanks Tom. I wasn't aware - I did do a quick search at the beginning but didn't turn this up. I'll post over on the hackers list. Terry On Sat, Oct 16, 2010 at 7:44 AM, Tom Lane wrote: > Terry Laurenzo writes: > > I'm a long-time postgres user but have never developed any extensions for > >

[GENERAL] installing from source in Windows

2010-10-16 Thread Turner, John J
I have MinGW installed and I've unpacked the pg 9.0 source files which now reside in the following path: * C:\Program Files\postgresql-9.0.0 In Chapter 15.5 of the 9.0 manual, the installation procedure basically begins by instructing me to run ./configure This command does not work. Much a

[GENERAL] Automated Database Backups

2010-10-16 Thread John Iliffe
Does anyone have a way to run pg_dump from cron in a way that doesn't require someone to enter the password on every run? I get the following error even when the backup user has read permissions on all application databases. The database that fails is part of the PostgreSQL kernel, not my appli

Re: [GENERAL] Fastest way to check database's existence

2010-10-16 Thread Raymond O'Donnell
On 16/10/2010 16:13, Kynn Jones wrote: I want to code a Perl function (part of a Perl library) for determining the existence of a particular database (in a given host/port). One way would be to just attempt making a connection to it, trapping any errors upon failure (with eval), or discarding th

Re: [GENERAL] Fastest way to check database's existence

2010-10-16 Thread Peter Geoghegan
> Is there an even faster way to check for a database's existence that does > not require establishing a connection? > (Maybe this question would be more suitable for the pgsql-performance list?) No. You have to connect to some database in particular to do anything. That's why the postgres databas

[GENERAL] Fastest way to check database's existence

2010-10-16 Thread Kynn Jones
I want to code a Perl function (part of a Perl library) for determining the existence of a particular database (in a given host/port). One way would be to just attempt making a connection to it, trapping any errors upon failure (with eval), or discarding the connection upon success. This approach

Re: [GENERAL] Request for comment: pgjson project

2010-10-16 Thread Tom Lane
Terry Laurenzo writes: > I'm a long-time postgres user but have never developed any extensions for > it. I had some time over the past week and decided to tackle a project I've > had on my list for a while: adding robust JSON capabilities to the database > server. Hm, are you aware that there's

[GENERAL] How to change pg_trigger query so that it works in 9.0 without pg_trigger.tgisconstraint does not exist error

2010-10-16 Thread Andrus Moor
In 9.0 query below returns error 7/42703:ERROR: column pg_trigger.tgisconstraint does not exist How to change it so that it works in all servers starting at 8.0 (or at least from 8.1) to 9.0 ? Or if this is not possible how to fix it so that it works in 9 ? Andrus SELECT pg_catalog.pg_get_t