How do you turn off notices using PostgreSQL 9?

Hey fellas,

I’m a MySQL to PostgreSQL “immigrant” due to Oracles fucking MySQL in
the ass lately, and I’ve migrated a Rails application successfully to
PostgreSQL 9. However, when running migrations/tests, etc., I get a
lot of notices similar to the following:

NOTICE: CREATE TABLE will create implicit sequence
“private_messages_id_seq” for serial column “private_messages.id”
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
“private_messages_pkey” for table “private_messages”

This is basically duplicated for each table that gets created. I
understand what it’s doing - basically just letting me know that it’s
setting up a sequence for the primary key in each table. That’s all
well and good, but it’s goddamn annoying - how the hell do I turn
these notices off? Additionally, is there something different I
should be doing in my migrations? Usually notices are there to tell
you that there’s something you should be doing a little differently,
and I realize that database agnosticism or not, there are going to be
some tangible differences between MySQL and PostgreSQL. Is there
something I need to do in my migrations to explicitly state that there
needs to be a sequence generated on the ‘id’ field so that it doesn’t
feel that it needs to toss out these notices?

One last thing: how the hell do you correctly pronounce PostgreSQL?
“Post-gray-sequel”, “Post-gress”, or something else? Additionally,
what’s the community’s opinion in general on performance for PGSQL 9
vs. MySQL 5.1? No holy wars here, please, just some constructive
comparisons.

Thanks :slight_smile:

database.yml:

test:
adapter: postgresql
database: dbname_test
username: username
min_messages: warning #magic sauce
host: localhost
encoding: UTF8

~Larry

Dear Larry,

You rock. That is all. :slight_smile:

  • Phoenix

(Thanks dude, it’s appreciated!)

Phoenix R. wrote in post #962053:

Hey fellas,

I’m a MySQL to PostgreSQL “immigrant” due to Oracles fuсking MySQL in
the ass lately, and I’ve migrated a Rails application successfully to
PostgreSQL 9.

Welcome to the world of decent DBs!

However, when running migrations/tests, etc., I get a
lot of notices similar to the following:

NOTICE: CREATE TABLE will create implicit sequence
“private_messages_id_seq” for serial column “private_messages.id”
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
“private_messages_pkey” for table “private_messages”

This is basically duplicated for each table that gets created. I
understand what it’s doing - basically just letting me know that it’s
setting up a sequence for the primary key in each table.

Right. PostgreSQL and MySQL handle autoincrements somewhat differently,
in that PostgreSQL has a separate sequence object for each
autoincrement. So it’s telling you that these objects are being
implicitly created even though you didn’t directly ask for them.

That’s all
well and good, but it’s goddamn annoying - how the hell do I turn
these notices off?

Why? Don’t you want to know what the DB is doing?

Additionally, is there something different I
should be doing in my migrations?

No. You could create the sequence objects explicitly, but there’s no
need to.

Usually notices are there to tell
you that there’s something you should be doing a little differently,

No. These are notices (information), not warnings or errors.

[…]

One last thing: how the hell do you correctly pronounce PostgreSQL?
“Post-gray-sequel”, “Post-gress”, or something else?

The PostgreSQL FAQ covers this.

Additionally,
what’s the community’s opinion in general on performance for PGSQL 9
vs. MySQL 5.1? No holy wars here, please, just some constructive
comparisons.

PostgreSQL is in general a much better database than MySQL. It’s
designed better (for example, I don’t think something like PostGIS could
be written for MySQL), and they’ve focused on writing one storage engine
that actually works well, rather than doing the MySQL cheat of forcing
you to choose between speed (MyISAM) and transactional and referential
integrity (InnoDB). PostgreSQL’s syntax also tends to stick closer to
the ANSI standard, and if you need to write stored procedures, you have
your choice of languages (SQL, C, Ruby, Perl, even Lolcode) – and the
procedural language actually works. (Ever tried to write stored
procedures in MySQL? The procedural language is a joke.)

PostgreSQL is a little harder to set up than MySQL, and I’m told that
clustering may not work as well, but I can think of few or no other
disadvantages. I don’t know why anyone still uses MySQL. :slight_smile:

Thanks :slight_smile:

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

On Nov 17, 2:28 am, Phoenix R. [email protected] wrote:

One last thing: how the hell do you correctly pronounce PostgreSQL?
“Post-gray-sequel”, “Post-gress”, or something else? Additionally,
what’s the community’s opinion in general on performance for PGSQL 9
vs. MySQL 5.1? No holy wars here, please, just some constructive
comparisons.

Thanks :slight_smile:

I understand the etymology to be Post-Ingres-SQL so I always say it as
post-gres-Q-L. Wikipedia says it sounds like this: /ˈpoʊstɡrɛs ˌkjuː
ˈɛl/. The postgresql.org website has survey results on the matter:
http://www.postgresql.org/community/survey.33.html.