PostgreSQL to MySQL schema differences
Madison Kelly
linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Tue Nov 22 20:47:19 UTC 2005
Alex Beamish wrote:
> On 11/21/05, *Madison Kelly* <linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
> <mailto:linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org>> wrote:
>
> Hi all,
>
> I am trying to get MySQL working on my backup program which, so far,
> only runs on PostgreSQL. I suspect this will be fine because I just use
> basic SQL calls (no stored procedures and such).
>
> My question is, my schema file I use to load the tables and data into
> the database on pgSQL doesn't work on MySQL (surprise). Is there any
> documentation on what is different between mysql and pgsql? I've been
> reading the MySQL docs (for v4.1) and I've learned how to create
> databases and users and such but I can't find anything on what is and is
> not valid. For example:
>
> CREATE TABLE schedule (
> sch_dom text default '*',
> ...
> );
>
> works on pgsql but fails on mysql saying:
>
> ERROR 1101 (42000) at line 67: BLOB/TEXT column 'sch_dom' can't have a
> default value
>
>
> Madison,
>
> I don't get that at all .. I get a happy little CREATE TABLE message,
> and displaying the table shows
>
> nov22=# \d schedule
> Table "public.schedule"
> Column | Type | Modifiers
> ---------+------+-------------
> sch_dom | text | default '*'
>
> I'm using 7.3.4 -- for now.
>
> Alex
Sounds like you tested that on PgSQL, ne? For me it is working on PgSQL
7.4+ but it fails on MySQL 4.1. To get around it I had to change 'text'
to 'varchar(##)'.
Madison
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list