Tom Lane | 1 Apr 2007 09:02
Picon

Re: Default value of column not respecting character length or domain restraints.

"Justin Dearing" <zippy1981 <at> gmail.com> writes:
> It seems I can feed a default value to a domain that won't fit in the
> underlying base type. I have the domain html_colors as so:

> CREATE DOMAIN html_color AS char(7) CHECK (VALUE ~ '^#[A-Fa-f0-9]{6}$');

> I then defined a column of html_colors as so:
> ALTER TABLE users ALTER COLUMN profile_color SET DEFAULT '#FFFFRFF';

> This worked fine and I didn't notice it until I added arecord to the
> users table and got the error:
> ERROR: value too long for type character(7).

> This behavior seems undesirable to me. Is this a known bug or is there
> a reason for this?

Well, the default isn't checked against constraints until it's used
at runtime.  This is appropriate in a number of situations because
time-varying defaults are not uncommon (eg "default now()" for a
timestamp column).  Also, defaults with side effects are not uncommon
--- think "default nextval('seq')" for a serial --- and causing those
side-effects to happen at CREATE TABLE time seems undesirable.

In short, I understand your annoyance, but the cure seems worse than
the disease.  It's not like you won't find out soon enough if you
establish a constant default that doesn't meet your constraints.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
(Continue reading)

Anton Melser | 1 Apr 2007 19:33
Picon

postgresl for mysql?

What will they think of next!
http://krow.livejournal.com/502908.html
I suppose it makes as much sense as the others, except why would you
want to use mysql if the storage is in postgres?
Cheers
Anton

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Steve Atkins | 1 Apr 2007 19:53

Re: postgresl for mysql?


On Apr 1, 2007, at 10:33 AM, Anton Melser wrote:

> What will they think of next!
> http://krow.livejournal.com/502908.html
> I suppose it makes as much sense as the others, except why would you
> want to use mysql if the storage is in postgres?

If you've inherited data in a postgresql database this will allow
you to migrate it to the industry standard database without the
inconvenience and downtime of a dump from postgresql and
a restore into mysql.

I don't think it's a new idea - IIRC, Aprile Pazzo did something
similar for MySQL 3 and PG 7.something.

Cheers,
   Steve

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo <at> postgresql.org so that your
       message can get through to the mailing list cleanly

Leonel | 1 Apr 2007 20:01
Picon

Re: postgresl for mysql?

On 4/1/07, Anton Melser <melser.anton <at> gmail.com> wrote:
> What will they think of next!
> http://krow.livejournal.com/502908.html
> I suppose it makes as much sense as the others, except why would you
> want to use mysql if the storage is in postgres?
> Cheers
> Anton
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>

Is today   Aprils Fool's ?

--

-- 
Leonel

---------------------------(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's datatypes do not
       match

RPK | 1 Apr 2007 20:04
Picon

Connecting a sequence with table column


I am using PGSQL 8.2.3 on Windows XP and pgAdmin 1.6.3. While adding columns
to a table from pgAdmin front-end, an option appears "sequence" with a
drop-down box on the column creation window, but it remains disabled. I have
already created a sequence but want to connect that sequence with this
column. How can I do this? Why this disabled drop-down box not enabling?
--

-- 
View this message in context: http://www.nabble.com/Connecting-a-sequence-with-table-column-tf3502025.html#a9780334
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Rohit Prakash Khare | 1 Apr 2007 19:28

Problem restoring from backup file

I am using PGSQL 8.2.3. I took a backup of my database selecting "Plain" option from pgAdmin 1.6. When I am
trying to restore it to a new machine having PGSQL 8.2.3 installed, using pgAdmin, the OK button of the
"Restore Backup Window" remains disabled. Why?

Have you checked out the new-look www.indiatimes.com yet?

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Oleg Bartunov | 1 Apr 2007 20:26
Picon

Re: Tsearch2 crashes my backend, ouch !

On Fri, 30 Mar 2007, Listmail wrote:

>
> 	OK, I've solved my problem... thanks for the hint !
>
> 	Anyway, just to signal that tsearch2 crashes if SELECT is not granted 
> to pg_ts_dict (other tables give a proper error message when not GRANTed).On

I don't understand this. Are sure on this ? 
From prompt in  your select examples I see you have superuser's rights 
and you have successfully select from pg_ts_dict column.

Oleg

> Fri, 30 Mar 2007 13:20:30 +0200, Listmail <lists <at> peufeu.com> wrote:
>
>>
>> 	Hello,
>>
>> 	I have just ditched Gentoo and installed a brand new kubuntu system 
>> (was tired of the endless compiles).
>> 	I have a problem with crashing tsearch2. This appeared both on Gentoo 
>> and the brand new kubuntu.
>>
>> 	I will describe all my install procedure, maybe I'm doing something 
>> wrong.
>>
>> 	Cluster is newly created and empty.
>> 
>> initdb was done with UNICODE encoding & locales.
(Continue reading)

Tom Lane | 1 Apr 2007 21:19
Picon

Re: postgresl for mysql?

Leonel <lnunez <at> gmail.com> writes:
> On 4/1/07, Anton Melser <melser.anton <at> gmail.com> wrote:
>> What will they think of next!
>> http://krow.livejournal.com/502908.html

> Is today   Aprils Fool's ?

Yup.  But he got me for about half a second, because this was proposed
entirely seriously by the MySQL AB folk back when they were looking for
a way out from under Oracle's purchase of InnoDB.  Since they hired Jim
Starkey to write "Falcon" for them, I don't think there's any interest
in that anymore over there.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Anton Melser | 1 Apr 2007 21:26
Picon

Re: postgresl for mysql?

OK, it got me for more than half a second...
:-)
And as you mention - not entirely ridiculous!
Cheers
Anton

On 01/04/07, Tom Lane <tgl <at> sss.pgh.pa.us> wrote:
> Leonel <lnunez <at> gmail.com> writes:
> > On 4/1/07, Anton Melser <melser.anton <at> gmail.com> wrote:
> >> What will they think of next!
> >> http://krow.livejournal.com/502908.html
>
> > Is today   Aprils Fool's ?
>
> Yup.  But he got me for about half a second, because this was proposed
> entirely seriously by the MySQL AB folk back when they were looking for
> a way out from under Oracle's purchase of InnoDB.  Since they hired Jim
> Starkey to write "Falcon" for them, I don't think there's any interest
> in that anymore over there.
>
>                         regards, tom lane
>

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

felix | 1 Apr 2007 22:06

Re: postgresl for mysql?

On Sun, Apr 01, 2007 at 10:53:06AM -0700, Steve Atkins wrote:
> 
> On Apr 1, 2007, at 10:33 AM, Anton Melser wrote:
> 
> >What will they think of next!
> >http://krow.livejournal.com/502908.html
> >I suppose it makes as much sense as the others, except why would you
> >want to use mysql if the storage is in postgres?
> 
> If you've inherited data in a postgresql database this will allow
> you to migrate it to the industry standard database without the
> inconvenience and downtime of a dump from postgresql and
> a restore into mysql.
> 
> I don't think it's a new idea - IIRC, Aprile Pazzo did something
> similar for MySQL 3 and PG 7.something.

What an interesting name!  I don't know much Italian other than what
I've picked up from a few movies, but I think I now know what Pazzo
means ...

--

-- 
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix <at> crowfix.com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

(Continue reading)


Gmane