Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 12th, 2005, 12:19 AM
Robert Creager
Guest
 
Posts: n/a
Default 7.4b4 domain usage and select question


I'm using 7.4b4 with domains, and am having a problem with selecting without
casting.

create domain test_domain as integer check( (value notnull) and (value >= 1) );
create table test_table( field_1 test_domain, field_2 integer );
insert into test_table values( 1, 1 );
insert into test_table values( '2', '2' );
select * from test_table where field_2 = '1';
select * from test_table where field_1 = '1'; -- fails

The last select fails with 'operator is not unique: test_domain = "unknown"'

The insert with quoted values works fine without casting.

The HINT indicates I need to cast, which works find with either '1'::integer or
'1'::test_domain. Is this the correct behavior? Do I have to cast every quoted
value? The values are quoted through the usage of DBD::Pg.

Thanks,
Rob

--
10:32:54 up 78 days, 2:58, 4 users, load average: 2.00, 2.00, 2.00

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAj+RbW8ACgkQgy51bQc2FFl5vgCgn6afbAnfzx joSTc+jP4CYsAS
pzgAn3so+rDuCWPiWQFaUeMBx3V/iHZo
=dS3J
-----END PGP SIGNATURE-----

  #2  
Old November 12th, 2005, 12:19 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: 7.4b4 domain usage and select question

Robert Creager <Robert_Creager@LogicalChaos.org> writes:[color=blue]
> select * from test_table where field_1 = '1'; -- fails
> The last select fails with 'operator is not unique: test_domain = "unknown"'[/color]

Works as expected in CVS tip ...

regards, tom lane

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

  #3  
Old November 12th, 2005, 12:19 AM
Robert Creager
Guest
 
Posts: n/a
Default Re: 7.4b4 domain usage and select question

When grilled further on (Sat, 18 Oct 2003 13:12:41 -0400),
Tom Lane <tgl@sss.pgh.pa.us> confessed:
[color=blue]
> Robert Creager <Robert_Creager@LogicalChaos.org> writes:[color=green]
> > select * from test_table where field_1 = '1'; -- fails
> > The last select fails with 'operator is not unique: test_domain = "unknown"'[/color]
>
> Works as expected in CVS tip ...
>
> regards, tom lane[/color]

Per your suggestion, I grabbed the nightly snapshot. It works fine for the
domain problem I was encountering.

But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0, but still logs the duration of every statement.
This didn't happen with 7.4b4... I've set it high to not log most statements.

Cheers,
Rob

--
13:36:33 up 78 days, 6:02, 4 users, load average: 2.00, 2.00, 2.00

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAj+RlxQACgkQgy51bQc2FFl9qwCgm1UI7A3hsN i3k7oezbjnAB5B
iyQAn3FmM75TRMOQDTbgNqbAcsSuvRGM
=Vg9S
-----END PGP SIGNATURE-----

  #4  
Old November 12th, 2005, 12:19 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: 7.4b4 domain usage and select question

Robert Creager <Robert_Creager@LogicalChaos.org> writes:[color=blue]
> But, I cannot turn of logging of the duration! It's set to
> log_min_duration_statement = 0,[/color]

-1 turns it off now.

regards, tom lane

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

  #5  
Old November 12th, 2005, 12:19 AM
Robert Creager
Guest
 
Posts: n/a
Default Re: 7.4b4 domain usage and select question

When grilled further on (Sat, 18 Oct 2003 15:46:55 -0400),
Tom Lane <tgl@sss.pgh.pa.us> confessed:
[color=blue]
> Robert Creager <Robert_Creager@LogicalChaos.org> writes:[color=green]
> > But, I cannot turn of logging of the duration! It's set to
> > log_min_duration_statement = 0,[/color]
>
> -1 turns it off now.
>[/color]

Thanks. Didn't even thing of doing another initdb to see if the setting may of
changed...

Cheers,
Rob

--
13:54:49 up 78 days, 6:20, 4 users, load average: 2.00, 2.00, 2.00

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAj+RmtoACgkQgy51bQc2FFkW3wCcCNk5ofwsHa xLDYSdsL/Y9FIS
1bMAoKJ7OnQeJ60M6g4cNFjk5rxSZ5cX
=YN/f
-----END PGP SIGNATURE-----

  #6  
Old November 12th, 2005, 12:19 AM
Alvaro Herrera
Guest
 
Posts: n/a
Default Re: 7.4b4 domain usage and select question

On Sat, Oct 18, 2003 at 01:40:04PM -0600, Robert Creager wrote:
[color=blue]
> But, I cannot turn of logging of the duration! It's set to
> log_min_duration_statement = 0, but still logs the duration of every
> statement. This didn't happen with 7.4b4... I've set it high to not
> log most statements.[/color]

The value has a different meaning now. You have to set it to -1 to
disable logging IIRC.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"In a specialized industrial society, it would be a disaster
to have kids running around loose." (Paul Graham)

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles