PostgreSQL set Default Value

I am facing issue while adding default value as ‘–’ in PostgreSQL It working when I set any integer instead ‘–’ but as I input ‘–’ in default column it showing error

Please help how to fix, I am using window GUI for postgresql

Does it work any better if you put quotes around it? I’ve never used this database, so I don’t know if they’d be single quotes or double quotes, but it seems logical that a string would be quoted. I’m not sure why the GUI doesn’t do it, given that it “knows” it’s a string column, but then I’ve never used the GUI either.

1 Like

they would be single quotes

1 Like

it worked, plese help me in one more this in mySQL phpMYAdmin we can et ‘enum’ but in postgresql ‘What we can use instead enum’ ?

my advice for this, and not just in postgresql but also in mysql, and also in every other database, is to use a reference table

enum is the spawn of the devil – here are some previous threads on sitepoint where i have advised the same

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.