dbTalk Databases Forums  

[BUGS] BUG #2557: field`s default value not restored in big sql script

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2557: field`s default value not restored in big sql script in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default [BUGS] BUG #2557: field`s default value not restored in big sql script - 08-01-2006 , 07:39 AM







The following bug has been logged online:

Bug reference: 2557
Logged by: Boris
Email address: boris_k (AT) iname (DOT) com
PostgreSQL version: 8.1.4
Operating system: win 2000, freebsd
Description: field`s default value not restored in big sql script
Details:

Hi!
This sql script was created by pd_dump.
(http://www.lanukr.com/upload/errordump.zip)
No error when i run this script to restore DB.
But table "auth"."access_flag" has wrong def value for "access_flag_id".
I think ii must be
nextval('auth.access_flag_access_flag_id_seq'::reg class).

From script it becomes nextval('access_flag_access_flag_id_seq'::regclass )

When I run a shot script to create this table - no problem. deff value is
correct for field "access_flag_id"

CREATE TABLE "auth"."access_flag_2" (
"access_flag_id" SERIAL,
"access_flag_name" TEXT NOT NULL,
"comments" TEXT,
"long_flag_name" TEXT,
CONSTRAINT "access_flag_2_access_flag_name_key"
UNIQUE("access_flag_name"),
CONSTRAINT "access_flag_2_pkey" PRIMARY KEY("access_flag_id")
)



HOW TO:
1. Create db test
2. restore db from script by
psql -d test -U your_user_name -f dump.sql >123.log 2<&1

3. check if table "auth"."access_flag" has a field "access_flag_id" as PK
and has deff value nextval('access_flag_access_flag_id_seq'::regclass ) (
error)

I can reproduse this error on "PostgreSQL 8.1.4 on i386-portbld-freebsd4.9,
compiled by GCC 2.95.4" too.

any info you need upon req.
ICQ 176869864
Boris

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

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: [BUGS] BUG #2557: field`s default value not restored in big sql script - 08-01-2006 , 07:43 AM






"Boris" <boris_k (AT) iname (DOT) com> writes:
Quote:
But table "auth"."access_flag" has wrong def value for "access_flag_id".
I think ii must be
nextval('auth.access_flag_access_flag_id_seq'::reg class).

From script it becomes nextval('access_flag_access_flag_id_seq'::regclass )
This is not wrong, or at least you haven't provided enough info to prove
that it is wrong. The display of a regclass constant is schema-aware.
Try doing \d on the table with search_path set to something that doesn't
include the auth schema ... does it show as auth.something then?

regards, tom lane

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

http://archives.postgresql.org


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.